public ActionResult Edit(Palestrante palestrante) { if (ModelState.IsValid) { db.Entry(palestrante).State = EntityState.Modified; return(RedirectToAction("Index")); } return(View(palestrante)); }
public ActionResult Edit(Track track) { if (ModelState.IsValid) { db.Entry(track).State = EntityState.Modified; return(RedirectToAction("Index")); } return(View(track)); }
public ActionResult Edit(Palestra palestra) { if (ModelState.IsValid) { var entry = db.Entry(palestra); entry.State = EntityState.Modified; return(RedirectToAction("Index")); } LoadPalestrantesAndTracksToViewBag(); return(View(palestra)); }
// PUT api/Palestras/5 public HttpResponseMessage PutPalestra(int id, Palestra palestra) { if (ModelState.IsValid && id == palestra.Id) { db.Entry(palestra).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, palestra)); } else { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } }