Skip to content

Instantly share code, notes, and snippets.

@aidanmorgan
Created June 16, 2011 14:59
Show Gist options
  • Save aidanmorgan/1029417 to your computer and use it in GitHub Desktop.
Save aidanmorgan/1029417 to your computer and use it in GitHub Desktop.
namespace WhiskeyRecommender.Persistence
{
/// <summary>
/// Simple base interface that defines standard operations that are performed by all repositories in the system.
/// </summary>
public interface IRepository<T>
{
/// <summary>
/// Returns an instance of <c>T</c> that has the provided id.
/// </summary>
T FindById(Guid id);
/// <summary>
/// Returns a <see cref="IQueryable"/> that allows querying all instances of type <c>T</c>.
/// </summary>
/// <returns></returns>
IQueryable<T> All();
/// <summary>
/// Returns all <c>T</c> that match the provided criteria.
/// </summary>
IQueryable<T> Query(Expression<Func<T, bool>> criteria);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment