コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public ActionResult Create()
 {
     var note = new Note() { Id = Guid.NewGuid() };
     return View("Edit", note);
 }