Пример #1
0
 public ActionResult Create(FormCollection form)
 {
     try
     {
         using (var context = new CatalogueContainer())
         {
             var article = new Article();
             TryUpdateModel(article, new[] { "Title", "Date" });
             article.Text = HttpUtility.HtmlDecode(form["Text"]);
             context.AddToArticle(article);
             context.SaveChanges();
             return RedirectToAction("Index", "Articles", new { area = "" });
         }
     }
     catch
     {
         return View();
     }
 }