refactor: add .editorconfig and refactor code

This commit is contained in:
2024-12-25 05:43:30 +03:00
parent 2a33ecbf07
commit 408a95e4b3
45 changed files with 371 additions and 75 deletions

View File

@ -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()
{

View File

@ -27,7 +27,7 @@ public class GetProfessorInfoSearchQueryHandler(IProfessorDbContext dbContext) :
Id = x.Id,
Name = x.Name,
AltName = x.AltName
}).ToList()
})
};
}
}

View File

@ -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; } = [];
}

View File

@ -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; } = [];
}