refactor: move database-related projects to a separate folder
This commit is contained in:
17
SqlData/Persistence/Contexts/Schedule/CampusDbContext.cs
Normal file
17
SqlData/Persistence/Contexts/Schedule/CampusDbContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
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 CampusDbContext(DbContextOptions<CampusDbContext> options) : DbContext(options), ICampusDbContext
|
||||
{
|
||||
public DbSet<Campus> Campuses { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new CampusConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
17
SqlData/Persistence/Contexts/Schedule/DisciplineDbContext.cs
Normal file
17
SqlData/Persistence/Contexts/Schedule/DisciplineDbContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
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 DisciplineDbContext(DbContextOptions<DisciplineDbContext> options) : DbContext(options), IDisciplineDbContext
|
||||
{
|
||||
public DbSet<Discipline> Disciplines { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new DisciplineConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
17
SqlData/Persistence/Contexts/Schedule/FacultyDbContext.cs
Normal file
17
SqlData/Persistence/Contexts/Schedule/FacultyDbContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
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 FacultyDbContext(DbContextOptions<FacultyDbContext> options) : DbContext(options), IFacultyDbContext
|
||||
{
|
||||
public DbSet<Faculty> Faculties { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new FacultyConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
17
SqlData/Persistence/Contexts/Schedule/GroupDbContext.cs
Normal file
17
SqlData/Persistence/Contexts/Schedule/GroupDbContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
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 GroupDbContext(DbContextOptions<GroupDbContext> options) : DbContext(options), IGroupDbContext
|
||||
{
|
||||
public DbSet<Group> Groups { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new GroupConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
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 LectureHallDbContext(DbContextOptions<LectureHallDbContext> options) : DbContext(options), ILectureHallDbContext
|
||||
{
|
||||
public DbSet<LectureHall> LectureHalls { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new LectureHallConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
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 LessonAssociationDbContext(DbContextOptions<LessonAssociationDbContext> options) : DbContext(options), ILessonAssociationDbContext
|
||||
{
|
||||
public DbSet<LessonAssociation> LessonAssociations { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new LessonAssociationConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
17
SqlData/Persistence/Contexts/Schedule/LessonDbContext.cs
Normal file
17
SqlData/Persistence/Contexts/Schedule/LessonDbContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
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 LessonDbContext(DbContextOptions<LessonDbContext> options) : DbContext(options), ILessonDbContext
|
||||
{
|
||||
public DbSet<Lesson> Lessons { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new LessonConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
17
SqlData/Persistence/Contexts/Schedule/ProfessorDbContext.cs
Normal file
17
SqlData/Persistence/Contexts/Schedule/ProfessorDbContext.cs
Normal file
@ -0,0 +1,17 @@
|
||||
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 ProfessorDbContext(DbContextOptions<ProfessorDbContext> options) : DbContext(options), IProfessorDbContext
|
||||
{
|
||||
public DbSet<Professor> Professors { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new ProfessorConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
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 SpecificWeekDbContext(DbContextOptions<SpecificWeekDbContext> options) : DbContext(options), ISpecificWeekDbContext
|
||||
{
|
||||
public DbSet<SpecificWeek> SpecificWeeks { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new SpecificWeekConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
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 TypeOfOccupationDbContext(DbContextOptions<TypeOfOccupationDbContext> options) : DbContext(options), ITypeOfOccupationDbContext
|
||||
{
|
||||
public DbSet<TypeOfOccupation> TypeOfOccupations { get; set; } = null!;
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.ApplyConfiguration(new TypeOfOccupationConfiguration());
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user