Exemplo n.º 1
0
 public int GetCount()
 {
     using (ERPEntities entities = new ERPEntities())
     {
         return(entities.Set <T>().Count());
     }
 }
Exemplo 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());
     }
 }
Exemplo n.º 3
0
 public List <T> GetAll()
 {
     using (ERPEntities entities = new ERPEntities())
     {
         return(entities.Set <T>().ToList());
     }
 }
Exemplo n.º 4
0
 public void Insert(T entity)
 {
     using (ERPEntities entities = new ERPEntities())
     {
         entities.Set <T>().Add(entity);
         entities.SaveChanges();
     }
 }