public IActionResult Create() { ReviewCommentCreateViewModel viewModel = new ReviewCommentCreateViewModel() { ReviewComment = new ReviewComment() }; return(View(viewModel)); }
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)); }