Skip to content

Commit

Permalink
Merge pull request #86 from cnblogs/fix-empty-result
Browse files Browse the repository at this point in the history
fix: allow model validation failed result to be returned
  • Loading branch information
ikesnowy authored Apr 13, 2023
2 parents 40d4b90 + 12023fd commit 9335fdb
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public CommandEndpointHandler(IMediator mediator, IOptions<CqrsHttpOptions> opti
"Expected ICommand<>, but got null, check if your delegate in MapCommand(route, delegate) returned non-null command");
}

if (command is not IBaseRequest)
{
// not command, return as-is
return command;
}

var response = await _mediator.Send(command);
if (response is null)
{
Expand Down

0 comments on commit 9335fdb

Please sign in to comment.