Refactor query behaviors for execution tracking
Refactored `BodyQueryBehavior` and `HeaderQueryBehavior` to introduce explicit execution tracking with new properties (`BodyQueryExecuted` and `HeaderQueryExecuted`). Updated `RecActionDto` to include computed properties (`IsBodyQueryReturnedNoData` and `IsHeaderQueryReturnedNoData`) for clearer null-checking logic. Removed the `IsReturnedNoData` tuple for simplicity. Updated `InvokeRecActionCommandHandler` to use the new `IsBodyQueryReturnedNoData` property. Improved logging for better diagnostics and clarified handling of null results in query behaviors.
This commit is contained in:
@@ -14,6 +14,9 @@ public class BodyQueryBehavior<TRecAction>(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);
|
||||
|
||||
Reference in New Issue
Block a user