コード例 #1
0
        /// <summary>
        /// Creates the search sort clause for the element passed in
        /// </summary>
        /// <param name="element">Element.</param>
        /// <returns>SortClause object to be used in a sort expression</returns>
        private static ISortClause CreateSearchSortClause(SearchResultsOrderSetting element)
        {
            ISortClause toReturn = null;

            switch (element)
            {
            case SearchResultsOrderSetting.ForumAscending:
                toReturn = ForumFields.ForumName.Ascending();
                break;

            case SearchResultsOrderSetting.ForumDescending:
                toReturn = ForumFields.ForumName.Descending();
                break;

            case SearchResultsOrderSetting.LastPostDateAscending:
                toReturn = ThreadFields.ThreadLastPostingDate.Ascending();
                break;

            case SearchResultsOrderSetting.LastPostDateDescending:
                toReturn = ThreadFields.ThreadLastPostingDate.Descending();
                break;

            case SearchResultsOrderSetting.ThreadSubjectAscending:
                toReturn = ThreadFields.Subject.Ascending();
                break;

            case SearchResultsOrderSetting.ThreadSubjectDescending:
                toReturn = ThreadFields.Subject.Descending();
                break;
            }

            return(toReturn);
        }
コード例 #2
0
 internal SortClauseBuilder(ISortClause obj, IStoreMapping storeMapping, StorageDialectSettings dialectSettings)
 {
     _obj             = obj ?? throw new ArgumentNullException(nameof(obj));
     _storeMapping    = storeMapping ?? throw new ArgumentNullException(nameof(storeMapping));
     _dialectSettings = dialectSettings ?? throw new ArgumentNullException(nameof(dialectSettings));
     _body            = new Dictionary <string, Orderby>();
     //_classMap = ClassMapCached.Fetch<TKey, TEntity>();
     this._classMap = ClassMapCached <TKey, TEntity> .ClassMap;
 }