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

27 lines
760 B
C#
Raw Normal View History

2019-12-12 15:24:47 +00:00
using ASC.Core.Common.EF.Model;
using Microsoft.EntityFrameworkCore;
2019-12-13 11:37:58 +00:00
using Microsoft.Extensions.DependencyInjection;
2019-12-12 15:24:47 +00:00
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-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
{
public static IServiceCollection AddDbContextService(this IServiceCollection services)
{
return services.AddDbContextManagerService<DbContext>();
}
}
2019-12-12 15:24:47 +00:00
}