Created
February 28, 2012 17:41
-
-
Save mendicantx/1933895 to your computer and use it in GitHub Desktop.
Repository
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 IRepository | |
{ | |
TEntity Get<TEntity>(Guid id) where TEntity : IEntity; | |
TEntity FindOne<Query, TEntity, Tparam>(Tparam param) where Query : ISingleItemQuery<TEntity, Tparam>, new(); | |
IEnumerable<TEntity> FindAllFor<Query, TEntity, TParameter>(TParameter parameter) | |
where Query : IFindAllQuery<TEntity, TParameter>, new() | |
where TEntity : IEntity; | |
void Save<TEntity>(TEntity entity) where TEntity : IEntity; | |
void Delete<TEntity>(TEntity entity) where TEntity : IEntity; | |
} | |
public interface ISingleItemQuery<TEntity, TParam> | |
{ | |
TEntity RunAgainst(ISession session, TParam param); | |
} | |
public interface IFindAllQuery<out TEntity, in TParameter> | |
{ | |
IEnumerable<TEntity> FindUsing(ISession session, TParameter parameter); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment