using ASC.Core.Common.EF.Model; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; namespace ASC.Core.Common.EF.Context { public class MessagesContext : BaseDbContext { public DbSet AuditEvents { get; set; } public DbSet LoginEvents { get; set; } public DbSet Tenants { get; set; } public DbSet WebstudioSettings { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.AddWebstudioSettings(); } } public static class MessagesContextExtension { public static IServiceCollection AddMessagesContextService(this IServiceCollection services) { services.TryAddScoped>(); services.TryAddScoped, ConfigureDbContext>(); services.TryAddScoped(); return services; } } }