Skip to content

Instantly share code, notes, and snippets.

@JonathanLoscalzo
Last active May 24, 2018 04:12
Show Gist options
  • Save JonathanLoscalzo/38954abc44aaa0a452dfca103a5d5712 to your computer and use it in GitHub Desktop.
Save JonathanLoscalzo/38954abc44aaa0a452dfca103a5d5712 to your computer and use it in GitHub Desktop.
IRepository example
public interface IRepository<Entity, Tkey> : IQueryable<Entity> where Entity : IBaseEntity<Tkey>
{
Entity Add(Entity entity);
void Add(IEnumerable<Entity> entities);
Entity FindById(string id);
IList<Entity> Find(Expression<Func<Entity, bool>> match);
IList<Entity> GetAll();
Entity Update(Entity item);
void Update(IEnumerable<Entity> entities);
void Delete(Tkey id);
void Delete(Entity entity);
void Delete(Expression<Func<Entity, bool>> predicate);
bool Exists(Expression<Func<Entity, bool>> predicate);
}
@JonathanLoscalzo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment