private HighliteTopicViewModel CreateHighliteTopicViewModel(HighliteTopic topic) { HighliteTopicViewModel vmodel = AutoMapper.Mapper.Map <HighliteTopicViewModel>(topic); vmodel.Items = topic.Items.Take(5).Select(i => CreateHighliteItemViewModel(i)).ToList(); return(vmodel); }
private HighliteTopic CreateTopicForPlaces(string title, IEnumerable <VisitedPlace> places) { var items = places.Select(pl => DoCreateHighliteItem(pl.Id, PickPlacePhoto(pl.Id), CountPlacePhoto(pl.Id), HighliteTarget.Place, pl.PlaceName)); var topic = new HighliteTopic(title, items.ToList()); return(topic); }
private List <HighliteTopic> CreateTopicsForAllPlaces() { List <HighliteTopic> topics = new List <HighliteTopic>(); var places = _tripStore.GetPlaces(); foreach (var place in places) { var items = places.Select(pl => DoCreateHighliteItem(pl.Id, PickPlacePhoto(pl.Id), CountPlacePhoto(pl.Id), HighliteTarget.Place, string.Empty)); var topic = new HighliteTopic($"{place.PlaceName}", items.ToList()); topics.Add(topic); } return(topics); }