Skip to content

Commit

Permalink
Tiny: Add InExpression argument check
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Dec 11, 2019
1 parent c69926a commit 7453f1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/EFCore.Relational/Query/SqlExpressions/InExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public virtual InExpression Update(
{
Check.NotNull(item, nameof(item));

if (values != null
&& subquery != null)
{
throw new ArgumentException($"Either {nameof(values)} or {nameof(subquery)} must be null");
}

return item != Item || subquery != Subquery || values != Values
? new InExpression(item, IsNegated, values, subquery, TypeMapping)
: this;
Expand Down

0 comments on commit 7453f1e

Please sign in to comment.