diff --git a/src/ReC.Application/OutResults/Queries/ReadOutResQuery.cs b/src/ReC.Application/OutResults/Queries/ReadOutResQuery.cs index 13791ab..27506a7 100644 --- a/src/ReC.Application/OutResults/Queries/ReadOutResQuery.cs +++ b/src/ReC.Application/OutResults/Queries/ReadOutResQuery.cs @@ -1,5 +1,6 @@ using AutoMapper; using DigitalData.Core.Abstraction.Application.Repository; +using DigitalData.Core.Exceptions; using MediatR; using Microsoft.EntityFrameworkCore; using ReC.Application.Common.Dto; @@ -26,8 +27,11 @@ public class ReadOutResHandler(IRepository repo, IMapper mapper) : IRequ if(request.ProfileId is long profileId) q = q.Where(res => res.Action!.ProfileId == profileId); - var dtos = await q.ToListAsync(cancel); + var resList = await q.ToListAsync(cancel); - return mapper.Map(dtos); + if (resList.Count == 0) + throw new NotFoundException(); + + return mapper.Map(resList); } } \ No newline at end of file