fix: error CS1061
All checks were successful
.NET Test Pipeline / build-and-test (pull_request) Successful in 2m7s

This commit is contained in:
Polianin Nikita 2024-05-19 12:44:35 +03:00
parent ca18804a33
commit d8f2f51cd7
2 changed files with 12 additions and 8 deletions

View File

@ -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,

View File

@ -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>