diff --git a/src/ReC.Application/Results/Queries/ReadResultViewQuery.cs b/src/ReC.Application/Results/Queries/ReadResultViewQuery.cs index 939e0c1..4a65a4e 100644 --- a/src/ReC.Application/Results/Queries/ReadResultViewQuery.cs +++ b/src/ReC.Application/Results/Queries/ReadResultViewQuery.cs @@ -16,6 +16,10 @@ public record ReadResultViewQuery : IRequest> public long? ActionId { get; init; } = null; public long? ProfileId { get; init; } = null; + + public bool IncludeAction { get; init; } = true; + + public bool IncludeProfile { get; init; } = false; } public class ReadResultViewQueryHandler(IRepository repo, IMapper mapper) : IRequestHandler> @@ -33,6 +37,12 @@ public class ReadResultViewQueryHandler(IRepository repo, IMapper ma if(request.ProfileId is long profileId) q = q.Where(rv => rv.ProfileId == profileId); + if(request.IncludeAction) + q = q.Include(rv => rv.Action); + + if(request.IncludeProfile) + q = q.Include(rv => rv.Profile); + var entities = await q.ToListAsync(cancel); if (entities.Count == 0)