Exemplo n.º 1
0
        public SearchData(ICrmEntitySearchResultPage resultPage, string queryText, IOrderedDictionary parameters)
        {
            if (resultPage == null)
            {
                throw new ArgumentNullException("resultPage");
            }

            _parameters = parameters ?? new OrderedDictionary();

            ApproximateTotalHits = resultPage.ApproximateTotalHits;
            PageNumber           = resultPage.PageNumber;
            PageSize             = resultPage.PageSize;
            Count     = resultPage.Count();
            QueryText = queryText;

            FirstResultNumber = ((PageNumber - 1) * PageSize) + 1;
            LastResultNumber  = (FirstResultNumber + Count) - 1;
        }
Exemplo n.º 2
0
        public SearchDataSourceStatusEventArgs(SearchProvider provider, ICrmEntityQuery query, ICrmEntitySearchResultPage results)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            if (results == null)
            {
                throw new ArgumentNullException("results");
            }

            Provider = provider;
            Query    = query;
            Results  = results;
        }