diff --git a/Application/Interfaces/DbContexts/Schedule/IDayDbContext.cs b/Application/Interfaces/DbContexts/Schedule/IDisciplineDbContext.cs similarity index 61% rename from Application/Interfaces/DbContexts/Schedule/IDayDbContext.cs rename to Application/Interfaces/DbContexts/Schedule/IDisciplineDbContext.cs index f34d77a..6b30d92 100644 --- a/Application/Interfaces/DbContexts/Schedule/IDayDbContext.cs +++ b/Application/Interfaces/DbContexts/Schedule/IDisciplineDbContext.cs @@ -3,7 +3,7 @@ using Mirea.Api.DataAccess.Domain.Schedule; namespace Mirea.Api.DataAccess.Application.Interfaces.DbContexts.Schedule; -public interface IDayDbContext : IDbContextBase +public interface IDisciplineDbContext : IDbContextBase { - DbSet Days { get; set; } + DbSet Disciplines { get; set; } } \ No newline at end of file diff --git a/Application/Interfaces/DbContexts/Schedule/IProfessorToLessonDbContext.cs b/Application/Interfaces/DbContexts/Schedule/ILessonAssociationDbContext.cs similarity index 56% rename from Application/Interfaces/DbContexts/Schedule/IProfessorToLessonDbContext.cs rename to Application/Interfaces/DbContexts/Schedule/ILessonAssociationDbContext.cs index ba6aba5..2ec1af2 100644 --- a/Application/Interfaces/DbContexts/Schedule/IProfessorToLessonDbContext.cs +++ b/Application/Interfaces/DbContexts/Schedule/ILessonAssociationDbContext.cs @@ -3,7 +3,7 @@ using Mirea.Api.DataAccess.Domain.Schedule; namespace Mirea.Api.DataAccess.Application.Interfaces.DbContexts.Schedule; -public interface IProfessorToLessonDbContext : IDbContextBase +public interface ILessonAssociationDbContext : IDbContextBase { - DbSet ProfessorToLessons { get; set; } + DbSet LessonAssociations { get; set; } } \ No newline at end of file diff --git a/Application/Interfaces/DbContexts/Schedule/ILessonToTypeOfOccupationDbContext.cs b/Application/Interfaces/DbContexts/Schedule/ILessonToTypeOfOccupationDbContext.cs deleted file mode 100644 index 0dacc7e..0000000 --- a/Application/Interfaces/DbContexts/Schedule/ILessonToTypeOfOccupationDbContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mirea.Api.DataAccess.Domain.Schedule; - -namespace Mirea.Api.DataAccess.Application.Interfaces.DbContexts.Schedule; - -public interface ILessonToTypeOfOccupationDbContext : IDbContextBase -{ - DbSet LessonToTypeOfOccupations { get; set; } -} \ No newline at end of file diff --git a/Persistence/Contexts/Schedule/DayDbContext.cs b/Persistence/Contexts/Schedule/DisciplineDbContext.cs similarity index 61% rename from Persistence/Contexts/Schedule/DayDbContext.cs rename to Persistence/Contexts/Schedule/DisciplineDbContext.cs index 2edbb3a..d0a5612 100644 --- a/Persistence/Contexts/Schedule/DayDbContext.cs +++ b/Persistence/Contexts/Schedule/DisciplineDbContext.cs @@ -5,13 +5,13 @@ using Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.Contexts.Schedule; -public class DayDbContext(DbContextOptions options) : DbContext(options), IDayDbContext +public class DisciplineDbContext(DbContextOptions options) : DbContext(options), IDisciplineDbContext { - public DbSet Days { get; set; } = null!; + public DbSet Disciplines { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { - modelBuilder.ApplyConfiguration(new DayConfiguration()); + modelBuilder.ApplyConfiguration(new DisciplineConfiguration()); base.OnModelCreating(modelBuilder); } } \ No newline at end of file diff --git a/Persistence/Contexts/Schedule/ProfessorToLessonDbContext.cs b/Persistence/Contexts/Schedule/LessonAssociationDbContext.cs similarity index 62% rename from Persistence/Contexts/Schedule/ProfessorToLessonDbContext.cs rename to Persistence/Contexts/Schedule/LessonAssociationDbContext.cs index 1673b68..773bc8a 100644 --- a/Persistence/Contexts/Schedule/ProfessorToLessonDbContext.cs +++ b/Persistence/Contexts/Schedule/LessonAssociationDbContext.cs @@ -5,13 +5,13 @@ using Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.Contexts.Schedule; -public class ProfessorToLessonDbContext(DbContextOptions options) : DbContext(options), IProfessorToLessonDbContext +public class LessonAssociationDbContext(DbContextOptions options) : DbContext(options), ILessonAssociationDbContext { - public DbSet ProfessorToLessons { get; set; } = null!; + public DbSet LessonAssociations { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { - modelBuilder.ApplyConfiguration(new ProfessorToLessonConfiguration()); + modelBuilder.ApplyConfiguration(new LessonAssociationConfiguration()); base.OnModelCreating(modelBuilder); } } \ No newline at end of file diff --git a/Persistence/Contexts/Schedule/LessonToTypeOfOccupationDbContext.cs b/Persistence/Contexts/Schedule/LessonToTypeOfOccupationDbContext.cs deleted file mode 100644 index 1aada5e..0000000 --- a/Persistence/Contexts/Schedule/LessonToTypeOfOccupationDbContext.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Mirea.Api.DataAccess.Application.Interfaces.DbContexts.Schedule; -using Mirea.Api.DataAccess.Domain.Schedule; -using Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; - -namespace Mirea.Api.DataAccess.Persistence.Contexts.Schedule; - -public class LessonToTypeOfOccupationDbContext(DbContextOptions options) : DbContext(options), ILessonToTypeOfOccupationDbContext -{ - public DbSet LessonToTypeOfOccupations { get; set; } = null!; - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyConfiguration(new LessonToTypeOfOccupationConfiguration()); - base.OnModelCreating(modelBuilder); - } -} \ No newline at end of file diff --git a/Persistence/UberDbContext.cs b/Persistence/UberDbContext.cs index 17a4c52..699cc49 100644 --- a/Persistence/UberDbContext.cs +++ b/Persistence/UberDbContext.cs @@ -6,29 +6,27 @@ namespace Mirea.Api.DataAccess.Persistence; public class UberDbContext(DbContextOptions options) : DbContext(options) { - public DbSet Days { get; set; } = null!; + public DbSet Campuses { get; set; } = null!; + public DbSet Disciplines { get; set; } = null!; + public DbSet Faculties { get; set; } = null!; public DbSet Groups { get; set; } = null!; public DbSet LectureHalls { get; set; } = null!; + public DbSet LessonAssociations { get; set; } = null!; public DbSet Lessons { get; set; } = null!; public DbSet Professors { get; set; } = null!; public DbSet TypeOfOccupations { get; set; } = null!; - public DbSet Faculties { get; set; } = null!; - public DbSet Campuses { get; set; } = null!; - public DbSet ProfessorToLessons { get; set; } = null!; - public DbSet LessonToTypeOfOccupations { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { - modelBuilder.ApplyConfiguration(new DayConfiguration()); + 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 FacultyConfiguration()); - modelBuilder.ApplyConfiguration(new CampusConfiguration()); - modelBuilder.ApplyConfiguration(new ProfessorToLessonConfiguration()); - modelBuilder.ApplyConfiguration(new LessonToTypeOfOccupationConfiguration()); base.OnModelCreating(modelBuilder); }