From fd7744e94e7b785edcb4fc4875e4df45c020cb49 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 12 Dec 2025 10:46:20 +0100 Subject: [PATCH] Include EndpointAuth in RecActionView query results Added .Include(act => act.EndpointAuth) to eagerly load the EndpointAuth navigation property when retrieving RecActionView entities. Also made a minor formatting adjustment to the check for empty action results. --- src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs b/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs index 9a248e0..c9ade74 100644 --- a/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs +++ b/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs @@ -38,9 +38,9 @@ public class ReadRecActionQueryHandler(IRepository repo, IMapper if (request.Invoked is bool invoked) query = invoked ? query.Where(act => act.Root!.OutRes != null) : query.Where(act => act.Root!.OutRes == null); - var actions = await query.ToListAsync(cancel); + var actions = await query.Include(act => act.EndpointAuth).ToListAsync(cancel); - if(actions.Count == 0) + if (actions.Count == 0) throw new NotFoundException($"No actions found for the profile {request.ProfileId}."); return mapper.Map>(actions);