Skip to content

Commit

Permalink
Query: Translate NegateChecked to SQL (#20848)
Browse files Browse the repository at this point in the history
Found by "observing" code
  • Loading branch information
smitpatel authored May 6, 2020
1 parent 59ae9ae commit 2f189a2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ protected override Expression VisitUnary(UnaryExpression unaryExpression)
return _sqlExpressionFactory.Not(sqlOperand);

case ExpressionType.Negate:
case ExpressionType.NegateChecked:
return _sqlExpressionFactory.Negate(sqlOperand);

case ExpressionType.Convert:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ protected override Expression VisitUnary(UnaryExpression unaryExpression)
return _sqlExpressionFactory.Not(sqlOperand);

case ExpressionType.Negate:
case ExpressionType.NegateChecked:
return _sqlExpressionFactory.Negate(sqlOperand);

case ExpressionType.Convert:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3554,6 +3554,23 @@ public virtual Task Include_collection_with_multiple_orderbys_complex_repeated(b
assertOrder: true);
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Include_collection_with_multiple_orderbys_complex_repeated_checked(bool async)
{
checked
{
return AssertIncludeQuery(
async,
ss => ss.Set<Level2>()
.Include(l2 => l2.OneToMany_Optional2)
.OrderBy(l2 => -l2.Level1_Required_Id)
.ThenBy(l2 => -l2.Level1_Required_Id).ThenBy(l2 => l2.Name),
new List<IExpectedInclude> { new ExpectedInclude<Level2>(e => e.OneToMany_Optional2, "OneToMany_Optional2") },
assertOrder: true);
}
}

[ConditionalFact]
public virtual void Entries_for_detached_entities_are_removed()
{
Expand Down Expand Up @@ -4911,7 +4928,7 @@ public virtual Task SelectMany_with_outside_reference_to_joined_table_correctly_
{
return AssertQuery(
async,
ss => from l1 in ss.Set<Level1>()
ss => from l1 in ss.Set<Level1>()
join l2 in ss.Set<Level2>() on l1.Id equals l2.Level1_Required_Id
join l3 in ss.Set<Level3>() on l2.Id equals l3.Level2_Required_Id
join l4 in ss.Set<Level4>() on l3.Id equals l4.Level3_Required_Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public override Task Include_collection_with_multiple_orderbys_complex_repeated(
return base.Include_collection_with_multiple_orderbys_complex_repeated(async);
}

[ConditionalTheory(Skip = "Issue#16752")]
public override Task Include_collection_with_multiple_orderbys_complex_repeated_checked(bool async)
{
return base.Include_collection_with_multiple_orderbys_complex_repeated_checked(async);
}

[ConditionalTheory(Skip = "Issue#16752")]
public override Task Include_collection_with_multiple_orderbys_member(bool async)
{
Expand Down

0 comments on commit 2f189a2

Please sign in to comment.