public async Task <List <ProviderSetViewModel> > FindMangas(string searchString) { if (searchString.Length <= 3) { return(new List <ProviderSetViewModel>()); } var mangas = await MangaIndex.FindMangas(searchString); return(WrapMangas(mangas)); }
public async Task <List <ProviderSetViewModel> > SelectedGenreChanged(Genre genre) { if ((SearchString?.Length ?? 0) > 3) { return(Instances.Where(m => m.MetaData.Genres.HasFlag(genre)).ToList()); } //if no search string .Where(kvp => kvp.Name.ToLowerInvariant().Contains(lower)) var mangas = await MangaIndex.FindMangas(genre).ConfigureAwait(false); return(mangas.Take(20).Select(g => Factory(g)).ToList()); }