コード例 #1
0
        public static IQueryable <SongInList> OrderBy(this IQueryable <SongInList> query, SongSortRule?sortRule, ContentLanguagePreference languagePreference)
        {
            if (sortRule == null)
            {
                return(query.OrderBy(s => s.Order));
            }

            return(SongLinkQueryableExtender.OrderBy(query, sortRule.Value, languagePreference));
        }
コード例 #2
0
        public static IQueryable <SongInList> WhereSongHasName(this IQueryable <SongInList> query, SearchTextQuery textQuery, bool includeDescription)
        {
            if (textQuery.IsEmpty)
            {
                return(query);
            }

            var expression = SongLinkQueryableExtender.GetChildHasNameExpression <SongInList>(textQuery);

            if (includeDescription)
            {
                expression = expression.Or(GetNotesExpression(textQuery));
            }

            return(query.Where(expression));
        }