Skip to content

Instantly share code, notes, and snippets.

@dealproc
Created March 17, 2019 07:12
Show Gist options
  • Save dealproc/d717af58b01808aa0097e43f3beee20e to your computer and use it in GitHub Desktop.
Save dealproc/d717af58b01808aa0097e43f3beee20e to your computer and use it in GitHub Desktop.
Multi-Tenant Solutions - IRepository<T>.cs
public interface IRepository<T> : IProject<T> where T : class, new() {
T Get(int id);
T GetFirst(Expression<Func<T, bool>> condition);
IEnumerable<T> GetAll();
T SaveOrUpdate(T entity);
IEnumerable<T> SaveOrUpdate(IEnumerable<T> entities);
void Delete(T item);
// other various operations on your repository of choice ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment