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