Пример #1
0
        public static IQueryable OrderBy(this IQueryable source, string ordering, params object[] values)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (ordering == null)
            {
                throw new ArgumentNullException("ordering");
            }
            ParameterExpression[] array = new ParameterExpression[]
            {
                Expression.Parameter(source.ElementType, "")
            };
            Class6 @class = new Class6(array, ordering, values);
            IEnumerable <Class3> enumerable = @class.method_4();
            Expression           expression = source.Expression;
            string text  = "OrderBy";
            string text2 = "OrderByDescending";

            foreach (Class3 current in enumerable)
            {
                expression = Expression.Call(typeof(Queryable), current.bool_0 ? text : text2, new Type[]
                {
                    source.ElementType,
                    current.expression_0.Type
                }, new Expression[]
                {
                    expression,
                    Expression.Quote(Expression.Lambda(current.expression_0, array))
                });
                text  = "ThenBy";
                text2 = "ThenByDescending";
            }
            return(source.Provider.CreateQuery(expression));
        }