diff --git a/src/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore/CommandEndpointHandler.cs b/src/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore/CommandEndpointHandler.cs index 20c5dad..0616ee6 100644 --- a/src/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore/CommandEndpointHandler.cs +++ b/src/Cnblogs.Architecture.Ddd.Cqrs.AspNetCore/CommandEndpointHandler.cs @@ -34,6 +34,12 @@ public CommandEndpointHandler(IMediator mediator, IOptions 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) {