WCF data services proxy class template


  1. public interface IRepository<T>
  2. {
  3.     IQueryable<T> GetAll();
  4.     T GetSingle(int id);
  5.     IQueryable<T> FindBy(Expression<Func<T, bool>> predicate);
  6.     IQueryable<T> Where(Expression<Func<T, bool>> predicate);
  7.     void Add(T entity);
  8.     void Delete(T entity);
  9.     void Update(T entity);        
  10. }
  11.        
  12. public IQueryable<Region> Where(Expression<Func<T, bool>> predicate)
  13. {  
  14.     return _context.(something general).Where(predicate);
  15. }
  16.        
  17. public IQueryable<Region> Where(Expression<Func<T, bool>> predicate)
  18. {  
  19.     return _context.Region.Where(predicate);
  20. }


Learn More :