Add Status to InsertResultCommand for query outcome reporting

Enhance PostprocessingBehavior and PreprocessingBehavior to set the Status property on InsertResultCommand. Status is now set to QuerySuccess on successful execution and QueryFailed on exceptions, improving clarity of query execution results.
This commit is contained in:
2026-03-30 11:11:51 +02:00
parent 3146acfa45
commit 606eccb855
2 changed files with 4 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi
await sender.Send(new InsertResultCommand()
{
Status = Status.QuerySuccess,
ActionId = request.Action.Id,
Info = info,
Type = ResultType.Post
@@ -35,6 +36,7 @@ public class PostprocessingBehavior(IRecDbContext context, ISender sender) : IPi
await sender.Send(new InsertResultCommand()
{
Status = Status.QueryFailed,
ActionId = request.Action.Id,
Error = error,
Type = ResultType.Post

View File

@@ -20,6 +20,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip
await sender.Send(new InsertResultCommand()
{
Status = Status.QuerySuccess,
ActionId = request.Action.Id,
Info = JsonSerializer.Serialize(result),
Type = ResultType.Pre
@@ -30,6 +31,7 @@ public class PreprocessingBehavior(IRecDbContext context, ISender sender) : IPip
{
await sender.Send(new InsertResultCommand()
{
Status = Status.QueryFailed,
ActionId = request.Action.Id,
Error = ex.ToString(),
Type = ResultType.Pre