示例#1
0
        public IActionResult Create()
        {
            ReviewCommentCreateViewModel viewModel = new ReviewCommentCreateViewModel()
            {
                ReviewComment = new ReviewComment()
            };

            return(View(viewModel));
        }
示例#2
0
        public IActionResult Create(ReviewCommentCreateViewModel viewModel)
        {
            ReviewComment comment = new ReviewComment()
            {
                ID          = viewModel.ReviewComment.ID,
                Body        = viewModel.ReviewComment.Body,
                DateCreated = DateTime.Now,
                CreatedByID = userManager.GetUserAsync(HttpContext.User).Result.Id,
                CreatedBy   = userManager.GetUserAsync(HttpContext.User).Result,
                Review      = viewModel.ReviewComment.Review
            };

            reviewCommentService.Insert(comment);

            return(View(viewModel));
        }