public ActionResult EditRating(RatingModel model) { if (ModelState.IsValid) { model.ModifiedBy = User.Identity.GetUserId(); var result = _ratMgr.UpdateRating(model); if (result.Succeeded == true) { TempData["message"] = $"Rating{model.RatId} was successfully added!"; ModelState.AddModelError(string.Empty, "Update was successfully "); return(RedirectToAction("Index")); } ModelState.AddModelError(string.Empty, result.Message); ViewBag.Error = $"Error occured : {result.Message}"; return(View(model)); } else { return(View(model)); } }