fix: return altName

This commit is contained in:
Polianin Nikita 2024-10-25 04:43:30 +03:00
parent 4605c81895
commit 84d7b095f0

View File

@ -11,12 +11,13 @@ public class GetProfessorInfoQueryHandler(IProfessorDbContext dbContext) : IRequ
{
public async Task<ProfessorInfoVm> Handle(GetProfessorInfoQuery request, CancellationToken cancellationToken)
{
var discipline = 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()
{
Id = discipline.Id,
Name = discipline.Name,
Id = professor.Id,
Name = professor.Name,
AltName = professor.AltName
};
}
}