public ActionResult Edit(Note note) { try { Couch.Uri.Put(note.Id,note); return RedirectToAction("Edit", new { id = note.Id }); } catch (WebException ex) { var statusCode = ((HttpWebResponse)ex.Response).StatusCode; if (statusCode != HttpStatusCode.Conflict) throw; ModelState.AddModelError("Revision", "Conflict Detected"); return View(note); } }
public ActionResult Create() { var note = new Note() { Id = Guid.NewGuid() }; return View("Edit", note); }