using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; namespace ASC.Core.Common.EF { public class UserDbContext : BaseDbContext { public DbSet Users { get; set; } public DbSet UserSecurity { get; set; } public DbSet Photos { get; set; } public DbSet Acl { get; set; } public DbSet Groups { get; set; } public DbSet UserGroups { get; set; } public DbSet Subscriptions { get; set; } public DbSet SubscriptionMethods { get; set; } public UserDbContext() { } public UserDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder .AddAcl() .AddSubscription() .AddSubscriptionMethod() .AddUser(); } } public static class UserDbExtension { public static IServiceCollection AddUserDbContextService(this IServiceCollection services) { return services.AddDbContextManagerService(); } } }