public IActionResult Add(Rating rating, string author, string name) { var identityUser = userManager.GetUserAsync(User).GetAwaiter().GetResult(); Book book = bookService.Get(author, name); rating.Book = book; rating.AddedDate = DateTime.Now; var user = userService.GetByIdentityUserId(identityUser.Id); ratingService.Add(rating); rankingService.AddByBook(rating); userService.AddRating(user, rating); return(RedirectToAction("Ratings")); }