Beispiel #1
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);
 }
Beispiel #2
0
 public bool Remove <T>(T t) where T : class
 {
     using (var dbContext = new PEISEntities())
     {
         dbContext.Entry(t).State = System.Data.Entity.EntityState.Deleted;
         if (dbContext.SaveChanges() != 0)
         {
             return(true);
         }
     }
     return(false);
 }