public IEnumerable<Book> getBooks(Publisher publisher) { if (publisher == null) { return new List<Book>(); } return Library.books.Where(x => String.Equals(x.publisherName, publisher.name, StringComparison.OrdinalIgnoreCase)); }
public Book getBook(Publisher publisher, string name) { return getBooks(publisher).Where(x => String.Equals(x.name, name, StringComparison.OrdinalIgnoreCase)).First(); }
private async Task<PublisherImageContainer> WrapPublisher(Publisher source) { PublisherImageContainer result = new PublisherImageContainer(); result.imageLocation = source.imageLocation; result.name = source.name; StorageFile file = Folder.GetFileAsync(source.imageLocation).AsTask().WaitAndUnwrapException(); result.imageSource = await getImage(file); return result; }