コード例 #1
0
        public ActionResult Create(FormCollection form)
        {
            try
            {
                using (var context = new CatalogueContainer())
                {
                    var attribute = new CategoryAttribute();
                    TryUpdateModel(attribute, new[] { "Title", "Name" });
                    context.AddToCategoryAttribute(attribute);
                    context.SaveChanges();
                }

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