internal static T[] PerformLookup <T>(IEnumerable <T> items, FeedSearchContinuationToken token) where T : PackageIdentity
 {
     return(items
            .Where(p => p.Id.IndexOf(token.SearchString, StringComparison.OrdinalIgnoreCase) != -1)
            .OrderBy(p => p.Id)
            .Skip(token.StartIndex)
            .ToArray());
 }
Beispiel #2
0
        public static Task <SearchResult <IPackageSearchMetadata> > SearchAsync(this SourceRepository sourceRepository, string searchText, SearchFilter searchFilter, int pageSize, CancellationToken cancellationToken)
        {
            var searchToken = new FeedSearchContinuationToken {
                SearchString = searchText,
                SearchFilter = searchFilter,
                StartIndex   = 0
            };

            return(sourceRepository.SearchAsync(searchToken, pageSize, cancellationToken));
        }
Beispiel #3
0
        public Task <SearchResult <IPackageSearchMetadata> > SearchAsync(string searchText, SearchFilter searchFilter, CancellationToken cancellationToken)
        {
            var searchToken = new FeedSearchContinuationToken
            {
                SearchString = searchText,
                SearchFilter = searchFilter,
                StartIndex   = 0
            };

            return(ContinueSearchAsync(searchToken, cancellationToken));
        }