diff --git a/src/ReC.Application/Common/Behaviors/BodyQueryBehavior.cs b/src/ReC.Application/Common/Behaviors/BodyQueryBehavior.cs index 4eb40ab..479c751 100644 --- a/src/ReC.Application/Common/Behaviors/BodyQueryBehavior.cs +++ b/src/ReC.Application/Common/Behaviors/BodyQueryBehavior.cs @@ -14,6 +14,9 @@ public class BodyQueryBehavior(IRecDbContext dbContext) : IPipelineB return await next(cancel); var result = await dbContext.BodyQueryResults.FromSqlRaw(action.BodyQuery).SingleOrDefaultAsync(cancel); + + action.BodyQueryExecuted = true; + action.Body = result?.RawBody; return await next(cancel); diff --git a/src/ReC.Application/Common/Behaviors/HeaderQueryBehavior.cs b/src/ReC.Application/Common/Behaviors/HeaderQueryBehavior.cs index 1b14bd7..537747a 100644 --- a/src/ReC.Application/Common/Behaviors/HeaderQueryBehavior.cs +++ b/src/ReC.Application/Common/Behaviors/HeaderQueryBehavior.cs @@ -17,12 +17,12 @@ public class HeaderQueryBehavior(IRecDbContext dbContext, ILogger(IRecDbContext dbContext, ILogger HeaderQueryExecuted && HeaderQuery is null; + public Dictionary? Headers { get; set; } public string? BodyQuery { get; init; } public string? Body { get; set; } - public (bool BodyQuery, bool HeaderQuery) IsReturnedNoData = (false, false); + public bool BodyQueryExecuted { get; set; } = false; + + public bool IsBodyQueryReturnedNoData => BodyQueryExecuted && Body is null; public string? PostprocessingQuery { get; init; } diff --git a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs index be24672..50b9099 100644 --- a/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/InvokeRecActionCommand.cs @@ -45,7 +45,7 @@ public class InvokeRecActionCommandHandler( using var reqBody = new StringContent(request.Body); httpReq.Content = reqBody; } - else if(request.BodyQuery is not null && !request.IsReturnedNoData.BodyQuery) + else if(request.BodyQuery is not null && !request.IsBodyQueryReturnedNoData) { logger?.LogWarning( "Although BodyQuery returns null, the IsReturnedNoData variable has not been set to TRUE. " +