Exemplo n.º 1
0
 public static CommentDetailModel MapToDetailModel(Comment comment)
 {
     return(new CommentDetailModel
     {
         Id = comment.Id,
         Author = UserMapper.MapToListModel(comment.Author),
         BelongsTo = PostMapper.MapToListModel(comment.BelongsTo),
         CreationTime = comment.CreationTime,
         Content = comment.Content
     });
 }
Exemplo n.º 2
0
        internal static ActivityDetailModel MapToDetailModel(Activity activity)
        {
            if (activity.GetType() == typeof(Comment))
            {
                return(CommentMapper.MapToDetailModel((Comment)activity));
            }

            if (activity.GetType() == typeof(Post))
            {
                return(PostMapper.MapToListModel((Post)activity));
            }

            throw new Exception("Invalid activity entity to map!");
        }