public ActionResult Create(CategoryBrand model) { try { using (var context = new SiteContainer()) { var category = context.Category.First(c => c.Id == model.CategoryId); var cache = new CategoryBrand { Category = category, SortOrder = model.SortOrder, Name = SiteHelper.UpdatePageWebName(model.Name), Title = model.Title }; context.AddToCategoryBrand(cache); context.SaveChanges(); return RedirectToAction("Details", "Category", new { area = "FactoryCatalogue", id = category.Name }); } } catch { return View(); } }