public FeedPostViewModel(UserPostDto feedItemDto) : base(feedItemDto.Post) { Username = feedItemDto.Username; ProfileImageUrl = feedItemDto.ProfileImageUrl ?? Constants.DEFAULT_PROFILE_IMAGE; Interest = feedItemDto.Interest; CommentCount = feedItemDto.Post.CommentCount; Comments = feedItemDto.Post.Comments.Take(2).Select(x => new FeedPostCommentViewModel { CommentText = x.CommentText, Username = x.Username }).ToList(); }
public PostFeedItemApiModel(UserPostDto userPostDto) { PostId = userPostDto.Post.PostId; MediumType = userPostDto.Post.MediumType; Description = userPostDto.Post.Description; ThumbImage = userPostDto.Post.ThumbImage; MediumImage = userPostDto.Post.MediumImage; FullImage = userPostDto.Post.FullImage; VideoUrl = userPostDto.Post.VideoUrl; WebSiteUrl = userPostDto.Post.WebSiteUrl; Title = userPostDto.Post.Title; Username = userPostDto.Username; ProfileImageUrl = userPostDto.ProfileImageUrl ?? Constants.DEFAULT_PROFILE_IMAGE; Interest = userPostDto.Interest; CommentCount = userPostDto.Post.CommentCount; Comments = userPostDto.Post.Comments.Take(2).Select( x => new PostCommentApiModel { CommentText = x.CommentText, Username = x.Username }).ToList(); }