Beispiel #1
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                using (var context = new LibraryContainer())
                {
                    var layout = new Layout();
                    TryUpdateModel(layout, new[] { "Name", "Title" });
                    context.AddToLayout(layout);
                    context.SaveChanges();
                }

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