Skip to content

Commit 7729810

Browse files
committed
PartialIndexFilterBuilder : add dedicated error for entity refs comparison
1 parent 9d94532 commit 7729810

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

Orm/Xtensive.Orm/Orm/Building/Builders/PartialIndexFilterBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ protected override Expression VisitBinary(BinaryExpression b)
8888
return BuildEntityCheck(field, b.NodeType);
8989
if (entityAccessMap.TryGetValue(right, out field) && IsNull(left))
9090
return BuildEntityCheck(field, b.NodeType);
91+
if (entityAccessMap.TryGetValue(left, out var _) && entityAccessMap.TryGetValue(right, out var _))
92+
throw UnableToTranslate(b, Strings.ComparisonOfTwoEntityFieldsIsNotSupported);
9193

9294
return base.VisitBinary(b);
9395

Orm/Xtensive.Orm/Strings.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Orm/Xtensive.Orm/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,4 +3473,7 @@ Error: {1}</value>
34733473
<data name="ExXExpressionsWithConstantValuesOfYTypeNotSupported" xml:space="preserve">
34743474
<value>{0} expressions with constant values of {1} type are not supported.</value>
34753475
</data>
3476+
<data name="ComparisonOfTwoEntityFieldsIsNotSupported" xml:space="preserve">
3477+
<value>Comparison of two entity fields is not supported.</value>
3478+
</data>
34763479
</root>

0 commit comments

Comments
 (0)