Пример #1
0
    /// <summary>
    /// Executes a search against the Concierge API
    /// </summary>
    /// <param name="serviceProxy">API Proxy</param>
    /// <param name="searchToRun">The search to run.</param>
    /// <param name="startRecord">The start record.</param>
    /// <param name="maximumNumberOfRecordsToReturn">The maximum number of records to return.</param>
    /// <returns></returns>
    public static SearchResult GetSearchResult(this IConciergeAPIService serviceProxy, Search searchToRun, int startRecord, int?maximumNumberOfRecordsToReturn)
    {
        var result = serviceProxy.ExecuteSearch(searchToRun, startRecord, maximumNumberOfRecordsToReturn);

        if (maximumNumberOfRecordsToReturn == null && result.ResultValue != null && result.ResultValue.TotalRowCount > MaxResultsDefault)
        {
            serviceProxy.AppendAdditional(searchToRun, result.ResultValue);
        }

        return(result.ResultValue);
    }
Пример #2
0
    /// <summary>
    /// Executes multiple searches against the Concierge API
    /// </summary>
    /// <param name="serviceProxy">API Proxy</param>
    /// <param name="searchesToRun">List of searches to run.</param>
    /// <param name="startRecord">The start record.</param>
    /// <param name="maximumNumberOfRecordsToReturn">The maximum number of records to return.</param>
    /// <returns></returns>
    public static List <SearchResult> GetMultipleSearchResults(this IConciergeAPIService serviceProxy, List <Search> searchesToRun, int startRecord, int?maximumNumberOfRecordsToReturn)
    {
        var results = serviceProxy.ExecuteSearches(searchesToRun, startRecord, maximumNumberOfRecordsToReturn);

        if (maximumNumberOfRecordsToReturn == null)
        {
            foreach (var result in results.ResultValue)
            {
                if (result != null && result.TotalRowCount > MaxResultsDefault)
                {
                    serviceProxy.AppendAdditional(searchesToRun.FirstOrDefault(s => s.ID == result.ID), result);
                }
            }
        }

        return(results.ResultValue);
    }