public ActionResult Create(ProductAttribute model) { try { using (var context = new ShopContainer()) { if (string.IsNullOrEmpty(model.ValueType)) model.ValueType = string.Empty; context.AddToProductAttribute(model); context.SaveChanges(); } return RedirectToAction("Index"); } catch { return View(); } }