refactor: use wrap DbContext
This commit is contained in:
@ -1,17 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Mirea.Api.DataAccess.Application.Interfaces.DbContexts.Schedule;
|
||||
using Mirea.Api.DataAccess.Domain.Schedule;
|
||||
using Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule;
|
||||
using Mirea.Api.DataAccess.Persistence.Common;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Mirea.Api.DataAccess.Persistence.Contexts.Schedule;
|
||||
|
||||
public class DisciplineDbContext(DbContextOptions<DisciplineDbContext> options) : DbContext(options), IDisciplineDbContext
|
||||
public sealed class DisciplineDbContext(DbContextOptions<DisciplineDbContext> options) : BaseDbContext<DisciplineDbContext>(options), IDisciplineDbContext
|
||||
{
|
||||
public DbSet<Discipline> Disciplines { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new DisciplineConfiguration());
|
||||
modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user