public void Update(TEntity entity) { using (var _context = new DBFullManagementRRSantosContext()) { _context.Entry(entity).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); } }
public void Create(TEntity entity) { using (var _context = new DBFullManagementRRSantosContext()) { _context.Set <TEntity>().Add(entity); _context.SaveChanges(); } }
public void Delete(object id) { using (var _context = new DBFullManagementRRSantosContext()) { var entity = _context.Set <TEntity>().Find(id); _context.Set <TEntity>().Remove(entity); _context.SaveChanges(); } }