public int GetCount() { using (ERPEntities entities = new ERPEntities()) { return(entities.Set <T>().Count()); } }
public List <S> Select <S>(Expression <Func <T, S> > selector) { using (ERPEntities entities = new ERPEntities()) { return(entities.Set <T>().Select(selector).ToList()); } }
public List <T> GetAll() { using (ERPEntities entities = new ERPEntities()) { return(entities.Set <T>().ToList()); } }
public void Insert(T entity) { using (ERPEntities entities = new ERPEntities()) { entities.Set <T>().Add(entity); entities.SaveChanges(); } }