Exemplo n.º 1
0
 public List <T> LoadAllItems <T>() where T : class
 {
     using (var dbContext = new PEISEntities())
     {
         return(dbContext.Set <T>().ToList());
     }
 }
Exemplo n.º 2
0
 public T Load <T>(Expression <Func <T, bool> > whereLambda) where T : class
 {
     using (var dbContext = new PEISEntities())
     {
         return(dbContext.Set <T>().Where(whereLambda).FirstOrDefault());
     }
 }
Exemplo n.º 3
0
 public List <T> LoadAll <T>(Expression <Func <T, bool> > whereLambda) where T : class
 {
     using (var dbContext = new PEISEntities())
     {
         return(dbContext.Set <T>().Where(whereLambda).ToList());
     }
 }
Exemplo n.º 4
0
 public bool Insert <T>(T t) where T : class
 {
     using (var dbContext = new PEISEntities())
     {
         dbContext.Set <T>().Add(t);
         if (dbContext.SaveChanges() != 0)
         {
             return(true);
         }
     }
     return(false);
 }