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