public async Task <IActionResult> PutStudent(int id, Student student) { if (id != student.Id) { return(BadRequest()); } _context.Entry(student).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutItem([FromRoute] int id, [FromBody] Item item) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != item.ID) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "RoomId,Name")] Room room) { if (ModelState.IsValid) { db.Entry(room).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(room)); }
public ActionResult Edit([Bind(Include = "Id,Nome,Telefone,CPF")] Cliente cliente) { if (ModelState.IsValid) { db.Entry(cliente).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cliente)); }
public ActionResult Edit([Bind(Include = "ID,Name,School,StartDate,EndDate")] Education education) { if (ModelState.IsValid) { db.Entry(education).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(education)); }
public ActionResult Edit([Bind(Include = "ID,Description")] Skills skills) { if (ModelState.IsValid) { db.Entry(skills).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(skills)); }
public ActionResult Edit([Bind(Include = "ID,Name,Address,City,ZipCode,PhoneNumber,Email")] Person person) { if (ModelState.IsValid) { db.Entry(person).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(person)); }
public ActionResult Edit([Bind(Include = "ID,WorkRole,CompanyName,StartDate,EndDate,Description")] Experience experience) { if (ModelState.IsValid) { db.Entry(experience).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(experience)); }
public ActionResult Edit(Student std) { var db = new MVCContext(); if (ModelState.IsValid) { db.Entry(std).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(std)); }