コード例 #1
0
        public async Task <IActionResult> Comment(UserCommentsDto commentsDto)
        {
            var comment = new UsersComment
            {
                CommentDate  = DateTime.Now,
                CommentText  = commentsDto.CommentText,
                Rating       = commentsDto.Rating,
                UserEmail    = commentsDto.UserEmail,
                UserFullName = commentsDto.UserFullName,
            };
            await _repo.AddtComment(comment);

            await _repo.SaveChanges();

            return(RedirectToAction("thanks", "Home"));
        }
コード例 #2
0
        public async Task <UsersComment> AddtComment(UsersComment comment)
        {
            await _context.AddAsync(comment);

            return(comment);
        }