Interface ICommand<TCommand, TResponse, TEndPointDefinition>
Represents a command interface that defines the contract for handling a specific command and its corresponding response sent over a specific endpoint (Exchange or Queue).
public interface ICommand<TCommand, TResponse, TEndPointDefinition> : _IRequest<TCommand, TResponse, TEndPointDefinition>, _IMessage<TCommand, TResponse, TEndPointDefinition>, _ICommand<TCommand, TResponse>, _IRequest<TCommand, TResponse>, _IMessage<TCommand, TResponse> where TCommand : ICommand<TCommand, TResponse, TEndPointDefinition> where TResponse : class where TEndPointDefinition : EndPointBase, new()
Type Parameters
TCommandThe type of the command.
TResponseThe type of the command response.
TEndPointDefinitionThe type of the endpoint definition where the command will be sent to (should inherit from ExchangeEndPoint or QueueEndPoint).
Examples
Example of a command definition
public class ExecuteSomethingCmd : ICommand<ExecuteSomethingCmd, ExecuteSomethingCmd.Response, MyQueueEndPoint>
{
public ExecuteSomethingCmd(string cmdData)
{
CmdData = cmdData;
}
public string CmdData { get; set; }
public class Response
{
public bool Success { get; set; }
}
}