Last active
May 24, 2018 04:12
-
-
Save JonathanLoscalzo/38954abc44aaa0a452dfca103a5d5712 to your computer and use it in GitHub Desktop.
IRepository example
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<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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
predicate related to https://gist.github.com/JonathanLoscalzo/ba3818af2596a47e17a28144963094ac