Exemplo n.º 1
0
 public ActionResult Create(Brands brands)
 {
     if (ModelState.IsValid)
     {
         if (brands.SaveAsNew())
         {
             return(RedirectToAction("Index"));
         }
         return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError));
     }
     ViewBag.Error = string.Join("\n", ModelState.Values.SelectMany(x => x.Errors));
     return(View(brands));
 }