refactor: add .editorconfig and refactor code
This commit is contained in:
@ -10,5 +10,5 @@ public class CampusBasicInfoVm
|
||||
/// <summary>
|
||||
/// The list of campus basic information.
|
||||
/// </summary>
|
||||
public IList<CampusBasicInfoDto> Campuses { get; set; } = new List<CampusBasicInfoDto>();
|
||||
public IEnumerable<CampusBasicInfoDto> Campuses { get; set; } = [];
|
||||
}
|
@ -11,7 +11,8 @@ public class GetCampusDetailsQueryHandler(ICampusDbContext dbContext) : IRequest
|
||||
{
|
||||
public async Task<CampusDetailsVm> Handle(GetCampusDetailsQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var campus = await dbContext.Campuses.FirstOrDefaultAsync(c => c.Id == request.Id, cancellationToken) ?? throw new NotFoundException(typeof(Domain.Schedule.Campus), request.Id);
|
||||
var campus = await dbContext.Campuses.FirstOrDefaultAsync(c => c.Id == request.Id, cancellationToken) ??
|
||||
throw new NotFoundException(typeof(Domain.Schedule.Campus), request.Id);
|
||||
|
||||
return new CampusDetailsVm()
|
||||
{
|
||||
|
@ -11,7 +11,8 @@ public class GetDisciplineInfoQueryHandler(IDisciplineDbContext dbContext) : IRe
|
||||
{
|
||||
public async Task<DisciplineInfoVm> Handle(GetDisciplineInfoQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var discipline = await dbContext.Disciplines.FirstOrDefaultAsync(d => d.Id == request.Id, cancellationToken) ?? throw new NotFoundException(typeof(Domain.Schedule.Discipline), request.Id);
|
||||
var discipline = await dbContext.Disciplines.FirstOrDefaultAsync(d => d.Id == request.Id, cancellationToken) ??
|
||||
throw new NotFoundException(typeof(Domain.Schedule.Discipline), request.Id);
|
||||
|
||||
return new DisciplineInfoVm()
|
||||
{
|
||||
|
@ -10,5 +10,5 @@ public class DisciplineListVm
|
||||
/// <summary>
|
||||
/// The list of disciplines.
|
||||
/// </summary>
|
||||
public IList<DisciplineLookupDto> Disciplines { get; set; } = new List<DisciplineLookupDto>();
|
||||
public IEnumerable<DisciplineLookupDto> Disciplines { get; set; } = [];
|
||||
}
|
@ -10,5 +10,5 @@ public class FacultyListVm
|
||||
/// <summary>
|
||||
/// The list of faculties.
|
||||
/// </summary>
|
||||
public IList<FacultyLookupDto> Faculties { get; set; } = new List<FacultyLookupDto>();
|
||||
public IEnumerable<FacultyLookupDto> Faculties { get; set; } = [];
|
||||
}
|
@ -14,9 +14,4 @@ public class FacultyLookupDto
|
||||
/// The name of the faculty.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ID indicating the faculty's affiliation to the campus.
|
||||
/// </summary>
|
||||
public int? CampusId { get; set; }
|
||||
}
|
@ -10,5 +10,5 @@ public class GroupListVm
|
||||
/// <summary>
|
||||
/// The list of groups.
|
||||
/// </summary>
|
||||
public IList<GroupLookupDto> Groups { get; set; } = new List<GroupLookupDto>();
|
||||
public IEnumerable<GroupLookupDto> Groups { get; set; } = [];
|
||||
}
|
@ -10,5 +10,5 @@ public class LectureHallListVm
|
||||
/// <summary>
|
||||
/// The list of lecture hall.
|
||||
/// </summary>
|
||||
public IList<LectureHallLookupDto> LectureHalls { get; set; } = new List<LectureHallLookupDto>();
|
||||
public IEnumerable<LectureHallLookupDto> LectureHalls { get; set; } = [];
|
||||
}
|
@ -11,7 +11,8 @@ public class GetProfessorInfoQueryHandler(IProfessorDbContext dbContext) : IRequ
|
||||
{
|
||||
public async Task<ProfessorInfoVm> Handle(GetProfessorInfoQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var professor = await dbContext.Professors.FirstOrDefaultAsync(p => p.Id == request.Id, cancellationToken) ?? throw new NotFoundException(typeof(Domain.Schedule.Professor), request.Id);
|
||||
var professor = await dbContext.Professors.FirstOrDefaultAsync(p => p.Id == request.Id, cancellationToken) ??
|
||||
throw new NotFoundException(typeof(Domain.Schedule.Professor), request.Id);
|
||||
|
||||
return new ProfessorInfoVm()
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ public class GetProfessorInfoSearchQueryHandler(IProfessorDbContext dbContext) :
|
||||
Id = x.Id,
|
||||
Name = x.Name,
|
||||
AltName = x.AltName
|
||||
}).ToList()
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
@ -11,5 +11,5 @@ public class ProfessorInfoListVm
|
||||
/// <summary>
|
||||
/// List of <see cref="ProfessorInfoVm"/>
|
||||
/// </summary>
|
||||
public required IList<ProfessorInfoVm> Details { get; set; }
|
||||
public IEnumerable<ProfessorInfoVm> Details { get; set; } = [];
|
||||
}
|
@ -10,5 +10,5 @@ public class ProfessorListVm
|
||||
/// <summary>
|
||||
/// The list of professors.
|
||||
/// </summary>
|
||||
public IList<ProfessorLookupDto> Professors { get; set; } = new List<ProfessorLookupDto>();
|
||||
public IEnumerable<ProfessorLookupDto> Professors { get; set; } = [];
|
||||
}
|
@ -83,7 +83,7 @@ public class GetScheduleListQueryHandler(ILessonDbContext dbContext) : IRequestH
|
||||
.Select(la => la.ProfessorId),
|
||||
|
||||
LinkToMeet = l.LessonAssociations!.Select(la => la.LinkToMeet)
|
||||
}).ToList();
|
||||
});
|
||||
|
||||
return new ScheduleListVm
|
||||
{
|
||||
|
@ -10,5 +10,5 @@ public class ScheduleListVm
|
||||
/// <summary>
|
||||
/// Gets or sets the list of schedules.
|
||||
/// </summary>
|
||||
public IList<ScheduleLookupDto> Schedules { get; set; } = new List<ScheduleLookupDto>();
|
||||
public IEnumerable<ScheduleLookupDto> Schedules { get; set; } = [];
|
||||
}
|
Reference in New Issue
Block a user