Skip to content

Commit

Permalink
fix: allow model validation failed result to be returned
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesnowy committed Apr 13, 2023
1 parent ecd3ba5 commit e4ed16f
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 e4ed16f

Please sign in to comment.