Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }