public void Insert(T entity) { using (DVDRentEntities context = new DVDRentEntities()) { context.Set <T>().Add(entity); context.SaveChanges(); } }
public void Delete(T entity) { using (DVDRentEntities context = new DVDRentEntities()) { context.Entry(entity).State = EntityState.Deleted; context.SaveChanges(); } }