public async Task Update(Phone entity) { using (_context = new PhonesContext()) { _context.Entry(entity.Modelo).State = EntityState.Modified; _context.Entry(entity).State = EntityState.Modified; await _context.SaveChangesAsync(); } }
public async Task Update(Modelo model) { using (_context = new PhonesContext()) { _context.Entry(model).State = EntityState.Modified; _context.Entry(model.Marca).State = EntityState.Unchanged; await _context.SaveChangesAsync(); } }
public async Task Update(RepairOrder entity) { using (_context = new PhonesContext()) { _context.Entry(entity.Phone).State = EntityState.Modified; _context.Entry(entity.Cliente).State = EntityState.Modified; _context.Entry(entity).State = EntityState.Modified; await _context.SaveChangesAsync(); } }
public async Task Delete(Phone entity) { using (_context = new PhonesContext()) { _context.Entry(entity).State = EntityState.Deleted; await _context.SaveChangesAsync(); } }
public async Task Delete(Modelo model) { using (_context = new PhonesContext()) { model = _context.Modelos.Find(model.Id); _context.Entry(model).State = EntityState.Deleted; await _context.SaveChangesAsync(); } }
public void Update(Reservation reservation) { _context.Reservations.Attach(reservation); _context.Entry(reservation).State = EntityState.Modified; _context.SaveChanges(); }