Esempio n. 1
0
        public ICollection <AlbumModel> GetAll()
        {
            var albums = Mapper.AlbumEntitiesToAlbumModels(_dataContext.Albums.ToList());

            foreach (var album in albums)
            {
                if (album.CoverPhotoId > 0)
                {
                    album.CoverPhotoPath = _dataContext.Photos.SingleOrDefault(x => x.Id == album.CoverPhotoId)?.Path;
                }
            }
            return(albums);
        }