Ejemplo n.º 1
0
        private AlbumSection CreateSection(Location location)
        {
            AlbumSection vmodel = AutoMapper.Mapper.Map <AlbumSection>(location);

            var photos = _photoStore.GetPhotosAtLocation(location.Id).ToList();

            vmodel.Items = photos.Select(p => CreateAlbumItem(p)).ToList();
            return(vmodel);
        }
Ejemplo n.º 2
0
        private HighliteTopic CreateTopicForLocation(string topicName, Location location)
        {
            var photos       = _photoStore.GetPhotosAtLocation(location.Id);
            var photosByDate = photos.GroupBy(p => p.Creation.ToShortDateString());

            var highliteItems = photosByDate.Select(g => DoCreateHighliteItem(
                                                        location.Id,
                                                        PickPhoto(g),
                                                        g.Count(),
                                                        HighliteTarget.Photos,
                                                        $"{g.Key}")).ToList();

            return(new HighliteTopic(topicName, highliteItems));
        }