Skip to content

Commit f2402ef

Browse files
committed
Address review comment
1 parent d82024e commit f2402ef

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/EFCore.SqlServer/Query/Internal/SqlServerQueryableMethodTranslatingExpressionVisitor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,10 @@ private ShapedQueryExpression TranslateWithApproximate(ShapedQueryExpression sou
811811
case { Limit: not null, Offset: not null }:
812812
throw new InvalidOperationException(SqlServerStrings.WithApproximateNotSupportedWithSkipAndTake);
813813

814+
// Already wrapped — calling WithApproximate() twice is a no-op.
815+
case { Limit: WithApproximateExpression }:
816+
return source;
817+
814818
// Normal case: WithApproximate() after Take() — wrap the Limit with WithApproximateExpression
815819
case { Limit: { } limit }:
816820
#pragma warning disable EF1001 // Internal EF Core API usage.

0 commit comments

Comments
 (0)