public UserDevice UpdateUserDevice(UserDevice userDevice) { _repairContext.Entry(userDevice).State = EntityState.Detached; var device = _repairContext.UserDevices.Attach(userDevice); _repairContext.Entry(userDevice).State = EntityState.Modified; _repairContext.SaveChanges(); return(userDevice); }
public RepairDevice UpdateRepairDevice(RepairDevice repairDevice) { _context.Entry(repairDevice).State = EntityState.Detached; var device = _context.RepairDevices.Attach(repairDevice); device.State = EntityState.Modified; _context.SaveChanges(); return(repairDevice); }