Class CommandResult<TResponse>
- Namespace
- Cratis.Applications.Commands
- Assembly
- Cratis.Applications.dll
Represents the result coming from executing a command with a response.
public class CommandResult<TResponse> : CommandResult
Type Parameters
TResponseType of the data returned.
- Inheritance
-
CommandResult<TResponse>
- Inherited Members
- Extension Methods
Constructors
CommandResult()
Initializes a new instance of the CommandResult<TResponse> class.
public CommandResult()
CommandResult(TResponse?)
Initializes a new instance of the CommandResult<TResponse> class.
public CommandResult(TResponse? response)
Parameters
responseTResponseThe response.
Properties
Response
Gets or sets the optional response object that will be returned from the command handler.
public TResponse? Response { get; set; }
Property Value
- TResponse
Methods
Success(CorrelationId)
Creates a new CommandResult representing a successful command execution.
public static CommandResult<TResponse> Success(CorrelationId correlationId)
Parameters
correlationIdCorrelationIdThe CorrelationId associated with the command.
Returns
- CommandResult<TResponse>