Esempio n. 1
0
 public void TestEditEntry()
 {
     var operations = new BlogOperations(new MockRepo());
     var blogEntry = operations.GetBlogEntry(1);
     blogEntry.BlogID = 1;
     blogEntry.PostContents = "edit";
     operations.EditBlogEntry(blogEntry);
     Assert.AreEqual("edit", operations.GetBlogEntry(1).PostContents);
 }
        public HttpResponseMessage Put(BlogEntry blogEntry)
        {
            var blogOp = new BlogOperations();
            blogOp.EditBlogEntry(blogEntry);

            var response = Request.CreateResponse(HttpStatusCode.OK, blogEntry);

            return response;
        }
        public ActionResult Edit(int id, BlogEntry blogEntry)
        {
            try
            {
                var blogOp = new BlogOperations();
                blogOp.EditBlogEntry(blogEntry);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }