コード例 #1
0
        /// <summary>
        /// Create a facet limit parameter
        /// </summary>
        /// <param name="documentSearch">Document search engine</param>
        /// <param name="conditional">Conditional to add parameter</param>
        /// <param name="value">Value of limit</param>
        /// <returns>Document search engine</returns>
        public static DocumentSearch <TDocument> FacetLimitIf <TDocument>(this DocumentSearch <TDocument> documentSearch, Func <bool> conditional, int value)
            where TDocument : Document
        {
            Checker.IsNull(conditional);

            if (conditional.Invoke())
            {
                documentSearch.FacetLimit(value);
            }

            return(documentSearch);
        }