Пример #1
0
 public static IdeaBannerViewModel MapFrom(IEnumerable <IdeaDto> ideas)
 {
     return(new IdeaBannerViewModel
     {
         Ideas = ideas.Select(idea => new IdeaBannerItem
         {
             Id = idea.Id,
             Name = idea.Title,
             Description = idea.Description,
             OwnerId = idea.OwnerId,
             Owner = IdeaOwnerInfo.CreateFrom(idea.Owner)
         }).ToList().AsReadOnly()
     });
 }
Пример #2
0
 private static IdeaInfoViewModel GetIdeaInfoViewModel(IdeaDto idea)
 {
     return(new IdeaInfoViewModel
     {
         Id = idea.Id,
         Title = idea.Title,
         Description = idea.Description,
         IsFundingRequired = idea.IsFundingRequired,
         FundingRequirement = idea.FundingRequirement,
         OwnerId = idea.OwnerId,
         Status = idea.Status,
         Owner = IdeaOwnerInfo.CreateFrom(idea.Owner),
         Likes = idea.Likes,
         DisLikes = idea.DisLikes,
         Comments = idea.Comments,
         Pages = idea.Pages.Select(i => new IdeaPageInfo
         {
             Name = i.Name,
             Content = i.Content,
         }).ToList()
     });
 }