public AdDTO(Ad ad) { Id = ad.Id.ToString(); Title = ad.Title; Description = ad.Description; Company = ad.Company; Owner = new UserInfoSmallDTO(ad.Owner); Applicants = UserInfoSmallDTO.ToUserInfoSmallDTOList(ad.UserAds?.Select(x => x.User)); }
public PostDTO(Post post) { Id = post.Id; Title = post.Title; FileName = post.FileName; User = new UserInfoSmallDTO(post.Owner); Subscribers = UserInfoSmallDTO.ToUserInfoSmallDTOList(post.UserPosts?.Select(x => x.User)); Comments = CommentDTO.ToCommentDTOList(post.Comments); Type = post.Type; PostedDate = post.PostedDate; Description = post.Description; }