public ActionResult CreateProduct(Product p) { try { if (ModelState.IsValid) { _service.AddProduct(p.Name, p.Price); return(RedirectToAction(nameof(Index))); } Log.Error("Model state invalid For Location Creation "); return(View()); }catch { return(View()); } }