From 3b6df031a675d6bbf6f04509ec25a3afeefa473f Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 4 Dec 2025 14:46:13 +0100 Subject: [PATCH] Add filtering for non-null OutRes in ReadRecActionQuery Enhanced the `Handle` method in `ReadRecActionQueryHandler` to include an additional filtering condition when querying the repository. The query now filters actions where `RootAction.OutRes` is not null, in addition to matching the `ProfileId`. This ensures that only relevant actions with a valid `OutRes` are included in the result set. --- src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs b/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs index 2b3202d..07374de 100644 --- a/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs +++ b/src/ReC.Application/RecActions/Queries/ReadRecActionQuery.cs @@ -26,7 +26,7 @@ public class ReadRecActionQueryHandler(IRepository repo, IMapper { public async Task> Handle(ReadRecActionQuery request, CancellationToken cancel) { - var actions = await repo.Where(x => x.ProfileId == request.ProfileId).ToListAsync(cancel); + var actions = await repo.Where(act => act.ProfileId == request.ProfileId).Where(act => act.RootAction!.OutRes != null).ToListAsync(cancel); if(actions.Count == 0) throw new NotFoundException($"No actions found for the profile {request.ProfileId}.");