public AlbumModel Build(Domain.Album album, List <Domain.Photo> photos) { return(new AlbumModel { Id = album.Id, Title = album.Title, UserId = album.UserId, Photos = photos.Select(x => _photoModelBuilder.Build(x)).ToList() }); }
///<inheritdoc /> public async Task <IEnumerable <IPhotoModel> > GetPhotosAsync(IEnumerable <string> fileNames) { var photos = new List <IPhotoModel>(); await Task.Run(() => { foreach (var fileName in fileNames) { using (var fs = new FileStream(fileName, FileMode.Open)) { var image = BitmapFrame.Create(fs); var photoModel = _builder.Build(fileName, image); photos.Add(photoModel); } } }); return(photos); }