public IActionResult AddRating(AddRating model) { if (ModelState.IsValid) { model.UserId = userService.GetUserId(); if (ratingManager.AddRating(model)) { return(RedirectToAction("Index", "Posts")); } } return(RedirectToAction("Index", "Posts")); }