public async Task <IActionResult> PutBattery(int id, Battery battery) { if (id != battery.id) { return(BadRequest()); } _context.Entry(battery).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BatteryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutLead(long id, Lead lead) { if (id != lead.id) { return(BadRequest()); } _context.Entry(lead).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeadExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutElevator(int id, Elevator elevator) { if (id != elevator.id) { return(BadRequest()); } _context.Entry(elevator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ElevatorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "ID,Email,Password")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "ID,Description,DueDateTime")] Task task) { if (ModelState.IsValid) { db.Entry(task).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(task)); }
public async Task <IActionResult> PutTodoItem(int?id, Taxon item) { if (id != item.TaxonId) { return(BadRequest()); } _infContext.Entry(item).State = EntityState.Modified; await _infContext.SaveChangesAsync(); return(NoContent()); }