Exemple #1
0
        public ActionResult Create(FormCollection form)
        {
            try
            {
                using (var context = new ShopContainer())
                {
                    var tag = new Tag {Name = form["Name"], Title = form["Title"]};
                    context.AddToTag(tag);
                    context.SaveChanges();
                }

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