示例#1
0
 public static DisplayCommentViewModel MapToDisplayComment(Comment comment, string userName)
 {
     DisplayCommentViewModel commentVM = new DisplayCommentViewModel();
     commentVM.Id = comment.Id;
     commentVM.Text = comment.Text;
     commentVM.Likes = comment.Likes;
     commentVM.DisLikes = comment.DisLikes;
     commentVM.CanDelete = false;
     commentVM.UserName = userName;
     return commentVM;
 }
示例#2
0
 public static DisplayCommentViewModel MapToDisplayComment(Comment comment, string userName, bool canDelete)
 {
     DisplayCommentViewModel commentVM = MapToDisplayComment(comment, userName);
     commentVM.CanDelete = canDelete;
     return commentVM;
 }