Share via


ExpressionExtensions.TryGetIndexerArguments Method

Definition

If the given a method-call expression represents a call to indexer on the entity, then this method extracts the entity expression and property name.

public static bool TryGetIndexerArguments (this System.Linq.Expressions.MethodCallExpression methodCallExpression, Microsoft.EntityFrameworkCore.Metadata.IModel model, out System.Linq.Expressions.Expression entityExpression, out string propertyName);
public static bool TryGetIndexerArguments (this System.Linq.Expressions.MethodCallExpression methodCallExpression, Microsoft.EntityFrameworkCore.Metadata.IModel model, out System.Linq.Expressions.Expression? entityExpression, out string? propertyName);
static member TryGetIndexerArguments : System.Linq.Expressions.MethodCallExpression * Microsoft.EntityFrameworkCore.Metadata.IModel * Expression * string -> bool
<Extension()>
Public Function TryGetIndexerArguments (methodCallExpression As MethodCallExpression, model As IModel, ByRef entityExpression As Expression, ByRef propertyName As String) As Boolean

Parameters

methodCallExpression
MethodCallExpression

The method-call expression for indexer.

model
IModel

The model to use.

entityExpression
Expression

The extracted entity access expression.

propertyName
String

The accessed property name.

Returns

true if the method-call was for indexer; false otherwise.

Applies to