diff --git a/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs b/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs index 4f71cc8ff4d..2e4134cc686 100644 --- a/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs +++ b/src/EFCore.Relational/Query/SqlExpressions/InExpression.cs @@ -25,6 +25,12 @@ private InExpression( RelationalTypeMapping typeMapping) : base(typeof(bool), typeMapping) { + if (values != null + && subquery != null) + { + throw new ArgumentException($"Either {nameof(values)} or {nameof(subquery)} must be null"); + } + Item = item; IsNegated = negated; Subquery = subquery;