Skip to content

Commit e4ed16f

Browse files
committed
fix: allow model validation failed result to be returned
1 parent ecd3ba5 commit e4ed16f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
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)