35 lines
1.8 KiB
C#
35 lines
1.8 KiB
C#
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using Mirea.Api.DataAccess.Domain.Schedule;
|
|||
|
using Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule;
|
|||
|
|
|||
|
namespace Mirea.Api.DataAccess.Persistence;
|
|||
|
|
|||
|
public class UberDbContext(DbContextOptions<UberDbContext> options) : DbContext(options)
|
|||
|
{
|
|||
|
public DbSet<Day> Days { get; set; } = null!;
|
|||
|
public DbSet<Group> Groups { get; set; } = null!;
|
|||
|
public DbSet<LectureHall> LectureHalls { get; set; } = null!;
|
|||
|
public DbSet<Lesson> Lessons { get; set; } = null!;
|
|||
|
public DbSet<Professor> Professors { get; set; } = null!;
|
|||
|
public DbSet<TypeOfOccupation> TypeOfOccupations { get; set; } = null!;
|
|||
|
public DbSet<Faculty> Faculties { get; set; } = null!;
|
|||
|
public DbSet<Campus> Campuses { get; set; } = null!;
|
|||
|
public DbSet<ProfessorToLesson> ProfessorToLessons { get; set; } = null!;
|
|||
|
public DbSet<LessonToTypeOfOccupation> LessonToTypeOfOccupations { get; set; } = null!;
|
|||
|
|
|||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|||
|
{
|
|||
|
modelBuilder.ApplyConfiguration(new DayConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new GroupConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new LectureHallConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new LessonConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new ProfessorConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new TypeOfOccupationConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new FacultyConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new CampusConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new ProfessorToLessonConfiguration());
|
|||
|
modelBuilder.ApplyConfiguration(new LessonToTypeOfOccupationConfiguration());
|
|||
|
|
|||
|
base.OnModelCreating(modelBuilder);
|
|||
|
}
|
|||
|
}
|