Skip to content

Commit

Permalink
InMemory: No-op for AsSplitQuery operator
Browse files Browse the repository at this point in the history
Manually verified
- Works for Relational
- No-op for InMemory
- Throws translation failure for Cosmos

Resolves #22034
  • Loading branch information
smitpatel committed Aug 17, 2020
1 parent bbde459 commit 9a97f48
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ protected InMemoryQueryableMethodTranslatingExpressionVisitor(
protected override QueryableMethodTranslatingExpressionVisitor CreateSubqueryVisitor()
=> new InMemoryQueryableMethodTranslatingExpressionVisitor(this);

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected override Expression VisitMethodCall(MethodCallExpression methodCallExpression)
{
if (methodCallExpression.Method.IsGenericMethod
&& methodCallExpression.Arguments.Count == 1
&& methodCallExpression.Arguments[0].Type.TryGetSequenceType() != null
&& string.Equals(methodCallExpression.Method.Name, "AsSplitQuery", StringComparison.Ordinal))
{
return Visit(methodCallExpression.Arguments[0]);
}

return base.VisitMethodCall(methodCallExpression);
}

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
Expand Down
8 changes: 0 additions & 8 deletions src/EFCore/Properties/CoreStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/EFCore/Properties/CoreStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1322,9 +1322,6 @@
<data name="IncludeWithCycle" xml:space="preserve">
<value>The Include path '{navigationName}-&gt;{inverseNavigationName}' results in a cycle. Cycles are not allowed in no-tracking queries. Either use a tracking query or remove the cycle.</value>
</data>
<data name="UnhandledMethod" xml:space="preserve">
<value>Unhandled method '{methodName}'.</value>
</data>
<data name="RuntimeParameterMissingParameter" xml:space="preserve">
<value>Runtime parameter extraction lambda must have one QueryContext parameter.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ LambdaExpression GetLambdaExpressionFromArgument(int argumentIndex) =>

return _subquery
? (Expression)null
: throw new NotImplementedException(CoreStrings.UnhandledMethod(method.Name));
: throw new InvalidOperationException(CoreStrings.TranslationFailed(methodCallExpression.Print()));
}

private sealed class EntityShaperNullableMarkingExpressionVisitor : ExpressionVisitor
Expand Down

0 comments on commit 9a97f48

Please sign in to comment.