From 84d7b095f0b6c403b45ab288a8b7b457bfcbb05e Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Fri, 25 Oct 2024 04:43:30 +0300 Subject: [PATCH] fix: return altName --- .../GetProfessorDetails/GetProfessorInfoQueryHandler.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SqlData/Application/Cqrs/Professor/Queries/GetProfessorDetails/GetProfessorInfoQueryHandler.cs b/SqlData/Application/Cqrs/Professor/Queries/GetProfessorDetails/GetProfessorInfoQueryHandler.cs index 868201d..2f833bf 100644 --- a/SqlData/Application/Cqrs/Professor/Queries/GetProfessorDetails/GetProfessorInfoQueryHandler.cs +++ b/SqlData/Application/Cqrs/Professor/Queries/GetProfessorDetails/GetProfessorInfoQueryHandler.cs @@ -11,12 +11,13 @@ public class GetProfessorInfoQueryHandler(IProfessorDbContext dbContext) : IRequ { public async Task 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 }; } } \ No newline at end of file