public ActionResult SubmitComment(CommentViewModel model) { if (ModelState.IsValid) { logics.SubmitComment(model, GetCurrentUserId()); } return CommentsListPart(model.ArticleId.Value); }
public void SubmitComment(CommentViewModel model, Int32 userId) { Mapper.CreateMap<CommentViewModel, CommentDTO>(); var articleDTO = Mapper.Map<CommentDTO>(model); articleDTO.UserId = userId; _service.AddComment(articleDTO); }