コード例 #1
0
        public async Task <IEnumerable <DataSet> > FindMatches(
            IReadonlyObjectDatabase <DataSet> objectDatabase,
            string searchText,
            uint maxSuggestions)
        {
            var normalizedSearchText = SearchTextNormalizer.Normalize(searchText);
            var searchQuery          = $"Data.{nameof(DataSet.Id)} LIKE '%{normalizedSearchText}%'";

            return(await objectDatabase.GetManyAsync(searchQuery, limit : maxSuggestions));
        }
コード例 #2
0
        public Task <IEnumerable <JObject> > FindMatches(
            IReadonlyObjectDatabase <JObject> objectDatabase,
            string searchText,
            uint maxSuggestions)
        {
            var normalizedSearchText = SearchTextNormalizer.Normalize(searchText);
            var query = $"Data.Id LIKE '%{normalizedSearchText}%'";

            return(objectDatabase.GetManyAsync(query, limit: maxSuggestions));
        }
コード例 #3
0
        public async Task <IEnumerable <DataCollectionProtocolParameter> > FindMatches(
            IReadonlyObjectDatabase <DataCollectionProtocolParameter> objectDatabase,
            string searchText,
            uint maxSuggestions)
        {
            var normalizedSearchText = SearchTextNormalizer.Normalize(searchText);
            var query = $"Data.Name LIKE '%{normalizedSearchText}%'";

            return(await objectDatabase.GetManyAsync(query, limit : maxSuggestions));
        }