System.Linq.Expressions.Expression.ArrayIndex C# (CSharp) Method

ArrayIndex() public static method

Creates a MethodCallExpression that represents applying an array index operator to a multi-dimensional array.
public static ArrayIndex ( Expression array ) : MethodCallExpression
array Expression An array of instances - indexes for the array index operation.
return MethodCallExpression
        public static MethodCallExpression ArrayIndex(Expression array, params Expression[] indexes)
        {
            return ArrayIndex(array, (IEnumerable<Expression>)indexes);
        }

Same methods

Expression::ArrayIndex ( Expression array, Expression index ) : BinaryExpression
Expression::ArrayIndex ( Expression array, IEnumerable indexes ) : MethodCallExpression

Usage Example

Ejemplo n.º 1
0
        public void ArrayIndex_index()
        {
            var expected = LinqExpression.ArrayIndex(
                LinqExpression.Parameter(
                    typeof(int[])),
                LinqExpression.Parameter(
                    typeof(int)));

            using var g = new GraphEngine.Graph();
            g.LoadFromString(@"
@prefix : <http://example.com/> .

:s
    :arrayIndexArray [
        :parameterType [
            :typeName ""System.Int32[]"" ;
        ] ;
    ] ;
    :arrayIndexIndex [
        :parameterType [
            :typeName ""System.Int32"" ;
        ] ;
    ] ;
.
");
            var s = g.GetUriNode(":s");

            var actual = Expression.Parse(s).LinqExpression;

            Console.WriteLine(actual.GetDebugView());

            actual.Should().Be(expected);
        }
All Usage Examples Of System.Linq.Expressions.Expression::ArrayIndex
Expression