Skip to content

Instantly share code, notes, and snippets.

@mhinze
Created September 24, 2009 18:38
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 mhinze/192943 to your computer and use it in GitHub Desktop.
Save mhinze/192943 to your computer and use it in GitHub Desktop.
public interface IRepository
{
void Save<ENTITY>(ENTITY entity)
where ENTITY : DomainEntity;
ENTITY Load<ENTITY>(Guid id)
where ENTITY : DomainEntity;
IQueryable<ENTITY> Query<ENTITY>()
where ENTITY : DomainEntity;
IQueryable<ENTITY> Query<ENTITY>(IDomainQuery<ENTITY> whereQuery)
where ENTITY : DomainEntity;
}
public interface IRepositoryWithTypedId<T, IdT>
{
T Get(IdT id);
IList<T> GetAll();
IList<T> FindAll(IDictionary<string, object> propertyValuePairs);
T FindOne(IDictionary<string, object> propertyValuePairs);
T SaveOrUpdate(T entity);
void Delete(T entity);
IDbContext DbContext { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment