using ASC.Common; using ASC.Core.Common.EF.Model; using Microsoft.EntityFrameworkCore; namespace ASC.Core.Common.EF.Context { public class TenantDbContext : BaseDbContext { public DbSet Tenants { get; set; } public DbSet Users { get; set; } public DbSet UserSecurity { get; set; } public DbSet TenantVersion { get; set; } public DbSet TenantPartner { get; set; } public DbSet TenantForbiden { get; set; } public DbSet TenantIpRestrictions { get; set; } public DbSet CoreSettings { get; set; } public TenantDbContext() { } public TenantDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.AddUser(); modelBuilder.AddCoreSettings(); modelBuilder.AddDbTenant(); } } public static class TenantDbExtension { public static DIHelper AddTenantDbContextService(this DIHelper services) { return services.AddDbContextManagerService(); } } }