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