DocSpace-buildtools/common/ASC.Core.Common/EF/Context/DbContext.cs

36 lines
907 B
C#
Raw Normal View History

2020-02-17 08:58:14 +00:00
using ASC.Common;
using ASC.Core.Common.EF.Model;
2019-12-12 15:24:47 +00:00
using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Context
{
public class DbContext : BaseDbContext
{
public DbSet<MobileAppInstall> MobileAppInstall { get; set; }
2019-12-13 13:05:24 +00:00
public DbSet<DbipLocation> DbipLocation { get; set; }
2019-12-17 08:27:38 +00:00
public DbSet<Regions> Regions { get; set; }
public DbContext()
{
}
public DbContext(DbContextOptions options) : base(options)
{
}
2019-12-12 15:24:47 +00:00
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.AddMobileAppInstall();
}
}
2019-12-13 11:37:58 +00:00
public static class DbContextExtension
{
2020-02-17 08:58:14 +00:00
public static DIHelper AddDbContextService(this DIHelper services)
2019-12-13 11:37:58 +00:00
{
return services.AddDbContextManagerService<DbContext>();
}
}
2019-12-12 15:24:47 +00:00
}