Beispiel #1
0
        //Important: Queries must not exceed 4096 characters.
        private async Task <EngineeringSearchPage> _Search(string _searchString, long _skip = 0, long _top = 100, EngineeringSearchMask _mask = EngineeringSearchMask.Default)
        {
            Dictionary <string, string> queryParams = new Dictionary <string, string>();

            queryParams.Add("$mask", _mask.GetString());
            queryParams.Add("$skip", _skip.ToString());
            queryParams.Add("$top", _top.ToString());
            queryParams.Add("$searchStr", _searchString);

            string searchResource = string.Format("{0}{1}", GetBaseResource(), SEARCH);

            IRestResponse requestResponse = await GetAsync(searchResource, queryParams);

            if (requestResponse.StatusCode != System.Net.HttpStatusCode.OK)
            {
                //handle according to established exception policy
                //throw (new DerivedOutputException(requestResponse));
            }

            return(JsonConvert.DeserializeObject <EngineeringSearchPage>(requestResponse.Content));
        }
Beispiel #2
0
 public async Task <EngineeringSearchPage> Search(SearchQuery _searchString, long _skip = 0, long _top = 100, EngineeringSearchMask _mask = EngineeringSearchMask.Default)
 {
     return(await _Search(_searchString.GetSearchString(), _skip, _top, _mask));
 }