sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/QueryTranslator.cs
/// <summary>
/// Gets the count argument value for a <c>Skip</c> or <c>Take</c> method call.
/// </summary>
/// <param name="expression">The method call expression.</param>
/// <returns>The count argument</returns>
Gets the count argument value for a SkipTake
Gets the count argument value for a SkipTake
internal protected static int GetCountArgument(MethodCallExpression expression)
        {
            Expression deepest = expression;
            if (expression?.Arguments.Count >= 2)
            {
                if (expression.Arguments[1] is ConstantExpression constant)
                {
                    deepest = constant;
                    if (constant.Value is int @int)
                    {
                        return @int;
                    }
                }
            }
            throw new NotSupportedException($"'{expression?.Method?.Name}' query expressions must consist of a single integer, not '{deepest?.ToString()}'.");
        }
internal protected static int GetCountArgument ( MethodCallExpression expression ) { Expression deepest = expression ; if ( expression ? . Arguments . Count >= 2 ) { if ( expression . Arguments [ 1 ] is ConstantExpression constant ) { deepest = constant ; if ( constant . Value is int @int ) { return @int ; } } } throw new NotSupportedException ( $" ' { expression ? . Method ? . Name } ' query expressions must consist of a single integer, not ' { deepest ? . ToString ( ) } '. " ) ; }
Gets the count argument value for a SkipTake
Gets the count argument value for a SkipTake
// We only allow Skip(x) expressions.  Anything else will result in an exception.
The count argument
The count argument
expression
MethodCallExpression
The method call expression.
The method call expression .