Last active
October 24, 2015 13:13
-
-
Save ScottGuymer/e167989e2f5985e2629e to your computer and use it in GitHub Desktop.
Design Patterns and Useful Methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ICommandHandler<TCommand> where TCommand : ICommand | |
{ | |
void Handle(TCommand command); | |
} | |
public interface ICommand | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IQueryHandler<TQuery, TResult> where TQuery : IQuery<TResult> | |
{ | |
TResult Handle(TQuery query); | |
} | |
public interface IQuery<TResult> | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
/// <summary> | |
/// An Interface to define a selector query that is used to return data from the database. | |
/// </summary> | |
/// <typeparam name="TIn">The type of the input to the query.</typeparam> | |
/// <typeparam name="TOut">The type of the output from the query.</typeparam> | |
public interface ISelect<in TIn, out TOut> | |
{ | |
TOut Run(IQueryable<TIn> objects); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment