public IActionResult AddRate(UserRateViewModel model) { if (ModelState.IsValid) { _ratingsService.AddRateToUser(new RaitingDTO { CourseId = model.CourseId, UserId = model.UserId, Grade = model.AddRate }); return(RedirectToAction("Index")); } else { int IdCourse = model.CourseId; return(RedirectToAction("AddRate", new { model.UserId, IdCourse })); } }