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); }
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); }