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
TResponse
Type of the data returned.
- Inheritance
-
CommandResult<TResponse>
- Inherited Members
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
response
TResponseThe 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
correlationId
CorrelationIdThe CorrelationId associated with the command.
Returns
- CommandResult<TResponse>