Add specific weeks of disciplines #10
@ -11,13 +11,15 @@ public class GetScheduleListQueryHandler(ILessonDbContext dbContext) : IRequestH
|
|||||||
{
|
{
|
||||||
public async Task<ScheduleListVm> Handle(GetScheduleListQuery request, CancellationToken cancellationToken)
|
public async Task<ScheduleListVm> Handle(GetScheduleListQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var query = dbContext.Lessons.Include(l => l.LessonAssociations)
|
var query = dbContext.Lessons
|
||||||
|
.Include(l => l.LessonAssociations)
|
||||||
.ThenInclude(la => la.LectureHall)
|
.ThenInclude(la => la.LectureHall)
|
||||||
.ThenInclude(lh => lh!.Campus)
|
.ThenInclude(lh => lh!.Campus)
|
||||||
.Include(l => l.LessonAssociations)
|
.Include(l => l.LessonAssociations)
|
||||||
.ThenInclude(la => la.Professor)
|
.ThenInclude(la => la.Professor)
|
||||||
|
.Include(l => l.LessonAssociations)
|
||||||
|
.ThenInclude(la => la.TypeOfOccupation)
|
||||||
.Include(l => l.Group)
|
.Include(l => l.Group)
|
||||||
.Include(l => l.TypeOfOccupation)
|
|
||||||
.Include(l => l.Discipline)
|
.Include(l => l.Discipline)
|
||||||
.AsQueryable();
|
.AsQueryable();
|
||||||
|
|
||||||
@ -46,7 +48,9 @@ public class GetScheduleListQueryHandler(ILessonDbContext dbContext) : IRequestH
|
|||||||
DayOfWeek = l.DayOfWeek,
|
DayOfWeek = l.DayOfWeek,
|
||||||
PairNumber = l.PairNumber,
|
PairNumber = l.PairNumber,
|
||||||
IsEven = l.IsEven,
|
IsEven = l.IsEven,
|
||||||
TypeOfOccupation = l.TypeOfOccupation!.ShortName,
|
TypeOfOccupations = l.LessonAssociations!
|
||||||
|
.Where(la => !string.IsNullOrEmpty(la.TypeOfOccupation?.ShortName))
|
||||||
|
.Select(la => la.TypeOfOccupation!.ShortName),
|
||||||
|
|
||||||
Discipline = l.Discipline!.Name,
|
Discipline = l.Discipline!.Name,
|
||||||
DisciplineId = l.DisciplineId,
|
DisciplineId = l.DisciplineId,
|
||||||
|
@ -33,11 +33,6 @@ public class ScheduleLookupDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public required int DisciplineId { get; set; }
|
public required int DisciplineId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the type of occupation.
|
|
||||||
/// </summary>
|
|
||||||
public required string TypeOfOccupation { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the name of the group.
|
/// Gets or sets the name of the group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -48,6 +43,11 @@ public class ScheduleLookupDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public required int GroupId { get; set; }
|
public required int GroupId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the type of occupation.
|
||||||
|
/// </summary>
|
||||||
|
public required IEnumerable<string> TypeOfOccupations { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the names of the lecture halls.
|
/// Gets or sets the names of the lecture halls.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user