Beispiel #1
0
        public async Task <IActionResult> LeaveComment(ViewChapterViewModel model)
        {
            var author = await userManager.FindByNameAsync(User.Identity.Name);

            fanficService.CreateComment(model.FanficId, author, model.CommentContent);
            return(Redirect("/Fanfic/ViewChapter/?fanficId=" + model.FanficId + "&number=" + model.ChapterNumber));
        }
Beispiel #2
0
        public async Task <IActionResult> SetRating(ViewChapterViewModel model)
        {
            var author = await userManager.FindByNameAsync(User.Identity.Name);

            if (!fanficService.IsRated(author, model.FanficId))
            {
                fanficService.SetRating(author, model.FanficId, model.Rating);
            }
            return(Redirect("/Fanfic/ViewChapter/?fanficId=" + model.FanficId + "&number=" + model.ChapterNumber));
        }