Skip to content

Commit 9335fdb

Browse files
authored
Merge pull request #86 from cnblogs/fix-empty-result
fix: allow model validation failed result to be returned
2 parents 40d4b90 + 12023fd commit 9335fdb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore/CommandEndpointHandler.cs

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public CommandEndpointHandler(IMediator mediator, IOptions<CqrsHttpOptions> opti
3434
"Expected ICommand<>, but got null, check if your delegate in MapCommand(route, delegate) returned non-null command");
3535
}
3636

37+
if (command is not IBaseRequest)
38+
{
39+
// not command, return as-is
40+
return command;
41+
}
42+
3743
var response = await _mediator.Send(command);
3844
if (response is null)
3945
{

0 commit comments

Comments
 (0)