Skip to content

Instantly share code, notes, and snippets.

@crmckenzie
Created February 8, 2013 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crmckenzie/4736237 to your computer and use it in GitHub Desktop.
Save crmckenzie/4736237 to your computer and use it in GitHub Desktop.
public interface ICommand<in TRequest, out TResponse> : IDisposable
{
TResponse Execute(TRequest request);
}
/// <summary>
/// Use Request.Empty when the command doesn't need any arguments.
/// </summary>
public class Request
{
public static readonly Request Empty = new Request();
private Request()
{
}
}
/// <summary>
/// Use Response.Empty when the command doesn't return any meaningful results.
/// </summary>
public class Response
{
public static readonly Response Empty = new Response();
private Response()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment