Skip to content

Commit ab5a78c

Browse files
committed
Fix VB string comparison
1 parent 37c653b commit ab5a78c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/NHibernate.Test/Async/Criteria/Lambda/IntegrationFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ public async Task QueryOverArithmeticAsync()
533533
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
534534
var persons7 = await (s.QueryOver<Person>().Where(p => (p.Age * 2) / 2 + 20 - 20 == null || p.Age * 2 == 20 * 1).ListAsync());
535535
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
536-
var val1 = await (s.QueryOver<Person>().Select(p => p.Age *2).Where( p => p.Age == 20).SingleOrDefaultAsync<int>());
536+
var val1 = await (s.QueryOver<Person>().Select(p => p.Age * 2).Where(p => p.Age == 20).SingleOrDefaultAsync<int>());
537537

538538
Assert.That(persons1.Count, Is.EqualTo(1));
539539
Assert.That(persons2.Count, Is.EqualTo(1));

src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ public void QueryOverArithmetic()
521521
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
522522
var persons7 = s.QueryOver<Person>().Where(p => (p.Age * 2) / 2 + 20 - 20 == null || p.Age * 2 == 20 * 1).List();
523523
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
524-
var val1 = s.QueryOver<Person>().Select(p => p.Age *2).Where( p => p.Age == 20).SingleOrDefault<int>();
524+
var val1 = s.QueryOver<Person>().Select(p => p.Age * 2).Where(p => p.Age == 20).SingleOrDefault<int>();
525525

526526
Assert.That(persons1.Count, Is.EqualTo(1));
527527
Assert.That(persons2.Count, Is.EqualTo(1));

src/NHibernate/Impl/ExpressionProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,14 @@ private static ICriterion ProcessSimpleNullExpression(ProjectionInfo property, E
613613

614614
private static ICriterion ProcessMemberExpression(Expression left, Expression right, ExpressionType nodeType)
615615
{
616-
ProjectionInfo leftProperty = FindMemberProjection(left);
617616
ProjectionInfo rightProperty = FindMemberProjection(right);
618617
if (rightProperty.IsConstant(out var constProjection))
619618
{
620619
return ProcessAsVisualBasicStringComparison(left, nodeType)
621620
?? ProcessSimpleExpression(left, constProjection.TypedValue, nodeType);
622621
}
623622

623+
ProjectionInfo leftProperty = FindMemberProjection(left);
624624
Func<ProjectionInfo, ProjectionInfo, ICriterion> propertyExpressionCreator;
625625
if (!_propertyExpressionCreators.TryGetValue(nodeType, out propertyExpressionCreator))
626626
throw new InvalidOperationException("Unhandled property expression type: " + nodeType);

0 commit comments

Comments
 (0)