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")); }
public async Task <UsersComment> AddtComment(UsersComment comment) { await _context.AddAsync(comment); return(comment); }