Use the configuration depending on the selected database provider #13
@ -1,10 +1,11 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
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;
|
||||
|
||||
public class UberDbContext(DbContextOptions<UberDbContext> options) : DbContext(options)
|
||||
public class UberDbContext(DbContextOptions<UberDbContext> options) : BaseDbContext<UberDbContext>(options)
|
||||
{
|
||||
public DbSet<Campus> Campuses { get; set; } = null!;
|
||||
public DbSet<Discipline> Disciplines { get; set; } = null!;
|
||||
@ -19,17 +20,7 @@ public class UberDbContext(DbContextOptions<UberDbContext> options) : DbContext(
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new CampusConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new DisciplineConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new FacultyConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new GroupConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new LectureHallConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new LessonConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new ProfessorConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new LessonAssociationConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new TypeOfOccupationConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new SpecificWeekConfiguration());
|
||||
|
||||
modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user