Skip to content

Commit

Permalink
Query: Don't terminate translation if indexer method does not bind to…
Browse files Browse the repository at this point in the history
… indexer property

Resolves #23410
  • Loading branch information
smitpatel committed Nov 24, 2020
1 parent 6ec33b4 commit 9535eda
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,13 @@ protected override Expression VisitMethodCall(MethodCallExpression methodCallExp
// EF Indexer property
if (methodCallExpression.TryGetIndexerArguments(_model, out source, out propertyName))
{
return TryBindMember(Visit(source), MemberIdentity.Create(propertyName));
var result = TryBindMember(Visit(source), MemberIdentity.Create(propertyName));
var useOldBehavior = AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue23410", out var enabled) && enabled;
if (result != null
|| useOldBehavior)
{
return result;
}
}

// GroupBy Aggregate case
Expand Down

0 comments on commit 9535eda

Please sign in to comment.