Skip to content

Commit 806e475

Browse files
Merge branch 'request-meta-tests-boilerplate' of https://github.com/mrmarcosmagalhaes/JsonApiDotNetCore into request-meta-tests-boilerplate
2 parents 19953bd + 481fd15 commit 806e475

36 files changed

Lines changed: 814 additions & 377 deletions

File tree

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2025.3.0.3",
6+
"version": "2025.3.1",
77
"commands": [
88
"jb"
99
],
@@ -17,7 +17,7 @@
1717
"rollForward": false
1818
},
1919
"dotnet-reportgenerator-globaltool": {
20-
"version": "5.5.0",
20+
"version": "5.5.1",
2121
"commands": [
2222
"reportgenerator"
2323
],

JsonApiDotNetCore.sln.DotSettings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/ReplaceWithPrimaryConstructorParameter/PreserveReadonlyModifier/@EntryValue">True</s:Boolean>
9898
<s:String x:Key="/Default/CodeInspection/Highlighting/UseCollectionExpression/ConvertEmptyCollection/@EntryValue">SUGGESTION</s:String>
9999
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/UseCollectionExpression/ConvertForInterfaceTargetTypes/@EntryValue">False</s:Boolean>
100-
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=JADNC_0020Full_0020Cleanup/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="JADNC Full Cleanup"&gt;&lt;XMLReformatCode&gt;True&lt;/XMLReformatCode&gt;&lt;CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeArgumentsStyle="True" ArrangeCodeBodyStyle="True" ArrangeVarStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" ArrangeNullCheckingPattern="True" /&gt;&lt;CssAlphabetizeProperties&gt;True&lt;/CssAlphabetizeProperties&gt;&lt;JsInsertSemicolon&gt;True&lt;/JsInsertSemicolon&gt;&lt;FormatAttributeQuoteDescriptor&gt;True&lt;/FormatAttributeQuoteDescriptor&gt;&lt;CorrectVariableKindsDescriptor&gt;True&lt;/CorrectVariableKindsDescriptor&gt;&lt;VariablesToInnerScopesDescriptor&gt;True&lt;/VariablesToInnerScopesDescriptor&gt;&lt;StringToTemplatesDescriptor&gt;True&lt;/StringToTemplatesDescriptor&gt;&lt;JsReformatCode&gt;True&lt;/JsReformatCode&gt;&lt;JsFormatDocComments&gt;True&lt;/JsFormatDocComments&gt;&lt;RemoveRedundantQualifiersTs&gt;True&lt;/RemoveRedundantQualifiersTs&gt;&lt;OptimizeImportsTs&gt;True&lt;/OptimizeImportsTs&gt;&lt;OptimizeReferenceCommentsTs&gt;True&lt;/OptimizeReferenceCommentsTs&gt;&lt;PublicModifierStyleTs&gt;True&lt;/PublicModifierStyleTs&gt;&lt;ExplicitAnyTs&gt;True&lt;/ExplicitAnyTs&gt;&lt;TypeAnnotationStyleTs&gt;True&lt;/TypeAnnotationStyleTs&gt;&lt;RelativePathStyleTs&gt;True&lt;/RelativePathStyleTs&gt;&lt;AsInsteadOfCastTs&gt;True&lt;/AsInsteadOfCastTs&gt;&lt;HtmlReformatCode&gt;True&lt;/HtmlReformatCode&gt;&lt;AspOptimizeRegisterDirectives&gt;True&lt;/AspOptimizeRegisterDirectives&gt;&lt;RemoveCodeRedundancies&gt;True&lt;/RemoveCodeRedundancies&gt;&lt;CSUseAutoProperty&gt;True&lt;/CSUseAutoProperty&gt;&lt;CSMakeFieldReadonly&gt;True&lt;/CSMakeFieldReadonly&gt;&lt;CSMakeAutoPropertyGetOnly&gt;True&lt;/CSMakeAutoPropertyGetOnly&gt;&lt;CSArrangeQualifiers&gt;True&lt;/CSArrangeQualifiers&gt;&lt;CSFixBuiltinTypeReferences&gt;True&lt;/CSFixBuiltinTypeReferences&gt;&lt;CssReformatCode&gt;True&lt;/CssReformatCode&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;/CSOptimizeUsings&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSharpFormatDocComments&gt;True&lt;/CSharpFormatDocComments&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;XAMLCollapseEmptyTags&gt;False&lt;/XAMLCollapseEmptyTags&gt;&lt;CSReformatInactiveBranches&gt;True&lt;/CSReformatInactiveBranches&gt;&lt;/Profile&gt;</s:String>
100+
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=JADNC_0020Full_0020Cleanup/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="JADNC Full Cleanup"&gt;&lt;XMLReformatCode&gt;True&lt;/XMLReformatCode&gt;&lt;CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeArgumentsStyle="True" ArrangeCodeBodyStyle="True" ArrangeVarStyle="True" ArrangeTrailingCommas="True" ArrangeObjectCreation="True" ArrangeDefaultValue="True" ArrangeNamespaces="True" ArrangeNullCheckingPattern="True" /&gt;&lt;CssAlphabetizeProperties&gt;True&lt;/CssAlphabetizeProperties&gt;&lt;JsInsertSemicolon&gt;True&lt;/JsInsertSemicolon&gt;&lt;FormatAttributeQuoteDescriptor&gt;True&lt;/FormatAttributeQuoteDescriptor&gt;&lt;CorrectVariableKindsDescriptor&gt;True&lt;/CorrectVariableKindsDescriptor&gt;&lt;VariablesToInnerScopesDescriptor&gt;True&lt;/VariablesToInnerScopesDescriptor&gt;&lt;StringToTemplatesDescriptor&gt;True&lt;/StringToTemplatesDescriptor&gt;&lt;JsReformatCode&gt;True&lt;/JsReformatCode&gt;&lt;JsFormatDocComments&gt;True&lt;/JsFormatDocComments&gt;&lt;RemoveRedundantQualifiersTs&gt;True&lt;/RemoveRedundantQualifiersTs&gt;&lt;OptimizeImportsTs&gt;True&lt;/OptimizeImportsTs&gt;&lt;OptimizeReferenceCommentsTs&gt;True&lt;/OptimizeReferenceCommentsTs&gt;&lt;PublicModifierStyleTs&gt;True&lt;/PublicModifierStyleTs&gt;&lt;ExplicitAnyTs&gt;True&lt;/ExplicitAnyTs&gt;&lt;TypeAnnotationStyleTs&gt;True&lt;/TypeAnnotationStyleTs&gt;&lt;RelativePathStyleTs&gt;True&lt;/RelativePathStyleTs&gt;&lt;AsInsteadOfCastTs&gt;True&lt;/AsInsteadOfCastTs&gt;&lt;HtmlReformatCode&gt;True&lt;/HtmlReformatCode&gt;&lt;AspOptimizeRegisterDirectives&gt;True&lt;/AspOptimizeRegisterDirectives&gt;&lt;RemoveCodeRedundancies&gt;True&lt;/RemoveCodeRedundancies&gt;&lt;CSUseAutoProperty&gt;True&lt;/CSUseAutoProperty&gt;&lt;CSMakeFieldReadonly&gt;True&lt;/CSMakeFieldReadonly&gt;&lt;CSMakeAutoPropertyGetOnly&gt;True&lt;/CSMakeAutoPropertyGetOnly&gt;&lt;CSArrangeQualifiers&gt;True&lt;/CSArrangeQualifiers&gt;&lt;CSFixBuiltinTypeReferences&gt;True&lt;/CSFixBuiltinTypeReferences&gt;&lt;CssReformatCode&gt;True&lt;/CssReformatCode&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;/CSOptimizeUsings&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSharpFormatDocComments&gt;True&lt;/CSharpFormatDocComments&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;XAMLCollapseEmptyTags&gt;False&lt;/XAMLCollapseEmptyTags&gt;&lt;CSReformatInactiveBranches&gt;True&lt;/CSReformatInactiveBranches&gt;&lt;CSharpReformatComments&gt;True&lt;/CSharpReformatComments&gt;&lt;/Profile&gt;</s:String>
101101
<s:String x:Key="/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue">JADNC Full Cleanup</s:String>
102102
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">Required</s:String>
103103
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">Required</s:String>

package-versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<DemystifierFrozenVersion>0.4.1</DemystifierFrozenVersion>
66
<HumanizerFrozenVersion>2.14.1</HumanizerFrozenVersion>
77
<NewtonsoftJsonFrozenVersion>13.0.4</NewtonsoftJsonFrozenVersion>
8-
<SwashbuckleFrozenVersion>10.0.1</SwashbuckleFrozenVersion>
8+
<SwashbuckleFrozenVersion>10.1.0</SwashbuckleFrozenVersion>
99
<SystemTextRegularExpressionsFrozenVersion>4.3.1</SystemTextRegularExpressionsFrozenVersion>
1010

1111
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
@@ -24,10 +24,10 @@
2424
<MiniValidationVersion>0.9.*</MiniValidationVersion>
2525
<NSwagApiClientVersion>14.6.*</NSwagApiClientVersion>
2626
<NewtonsoftJsonVersion>13.0.*</NewtonsoftJsonVersion>
27-
<PolyfillVersion>9.3.*</PolyfillVersion>
27+
<PolyfillVersion>9.4.*</PolyfillVersion>
2828
<ReadableExpressionsVersion>4.1.*</ReadableExpressionsVersion>
2929
<ScalarAspNetCoreVersion>2.11.*</ScalarAspNetCoreVersion>
30-
<SwashbuckleVersion>[10.0.*-*,10.0.2)</SwashbuckleVersion>
30+
<SwashbuckleVersion>10.*-*</SwashbuckleVersion>
3131
<SystemTextJsonVersion>10.0.*</SystemTextJsonVersion>
3232
<TestSdkVersion>18.0.*</TestSdkVersion>
3333
<XunitVersion>2.9.*</XunitVersion>

src/Examples/DapperExample/TranslationToSql/Builders/SelectStatementBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,13 +678,13 @@ private CountNode GetCountClause(CountExpression expression, TableAccessorNode o
678678

679679
public override SqlTreeNode VisitMatchText(MatchTextExpression expression, TableAccessorNode tableAccessor)
680680
{
681-
var column = (ColumnNode)Visit(expression.TargetAttribute, tableAccessor);
681+
var column = (ColumnNode)Visit(expression.MatchTarget, tableAccessor);
682682
return new LikeNode(column, expression.MatchKind, (string)expression.TextValue.TypedValue);
683683
}
684684

685685
public override SqlTreeNode VisitAny(AnyExpression expression, TableAccessorNode tableAccessor)
686686
{
687-
var column = (ColumnNode)Visit(expression.TargetAttribute, tableAccessor);
687+
var column = (ColumnNode)Visit(expression.MatchTarget, tableAccessor);
688688

689689
ReadOnlyCollection<ParameterNode> parameters =
690690
VisitSequence<LiteralConstantExpression, ParameterNode>(expression.Constants.OrderBy(constant => constant.TypedValue), tableAccessor);

src/JsonApiDotNetCore.Annotations/TypeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal static class TypeExtensions
77
/// </summary>
88
public static bool IsOrImplementsInterface<TInterface>(this Type? source)
99
{
10-
return IsOrImplementsInterface(source, typeof(TInterface));
10+
return source.IsOrImplementsInterface(typeof(TInterface));
1111
}
1212

1313
/// <summary>
Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,11 @@
11
using System.Diagnostics.CodeAnalysis;
2-
using System.Reflection;
32
using Microsoft.OpenApi;
43
using Swashbuckle.AspNetCore.SwaggerGen;
54

65
namespace JsonApiDotNetCore.OpenApi.Swashbuckle;
76

87
internal static class SchemaRepositoryExtensions
98
{
10-
private const string ReservedIdsFieldName = "_reservedIds";
11-
private static readonly FieldInfo ReservedIdsField = GetReservedIdsField();
12-
13-
private static FieldInfo GetReservedIdsField()
14-
{
15-
FieldInfo? field = typeof(SchemaRepository).GetField(ReservedIdsFieldName, BindingFlags.Instance | BindingFlags.NonPublic);
16-
17-
if (field == null)
18-
{
19-
throw new InvalidOperationException($"Failed to locate private field '{ReservedIdsFieldName}' " +
20-
$"in type '{typeof(SchemaRepository).FullName}' in assembly '{typeof(SchemaRepository).Assembly.FullName}'.");
21-
}
22-
23-
if (field.FieldType != typeof(Dictionary<Type, string>))
24-
{
25-
throw new InvalidOperationException($"Unexpected type '{field.FieldType}' of private field '{ReservedIdsFieldName}' " +
26-
$"in type '{typeof(SchemaRepository).FullName}' in assembly '{typeof(SchemaRepository).Assembly.FullName}'.");
27-
}
28-
29-
return field;
30-
}
31-
329
public static OpenApiSchemaReference LookupByType(this SchemaRepository schemaRepository, Type schemaType)
3310
{
3411
ArgumentNullException.ThrowIfNull(schemaRepository);
@@ -48,24 +25,4 @@ public static bool TryLookupByTypeSafe(this SchemaRepository schemaRepository, T
4825
referenceSchema = result ? obliviousReferenceSchema : null;
4926
return result;
5027
}
51-
52-
public static void ReplaceSchemaId(this SchemaRepository schemaRepository, Type oldSchemaType, string newSchemaId)
53-
{
54-
ArgumentNullException.ThrowIfNull(schemaRepository);
55-
ArgumentNullException.ThrowIfNull(oldSchemaType);
56-
ArgumentException.ThrowIfNullOrEmpty(newSchemaId);
57-
58-
if (schemaRepository.TryLookupByTypeSafe(oldSchemaType, out OpenApiSchemaReference? referenceSchema))
59-
{
60-
string oldSchemaId = referenceSchema.GetReferenceId();
61-
62-
IOpenApiSchema targetSchema = schemaRepository.Schemas[oldSchemaId];
63-
64-
schemaRepository.Schemas.Remove(oldSchemaId);
65-
schemaRepository.Schemas.Add(newSchemaId, targetSchema);
66-
67-
var reservedIds = (Dictionary<Type, string>)ReservedIdsField.GetValue(schemaRepository)!;
68-
reservedIds.Remove(oldSchemaType);
69-
}
70-
}
7128
}

src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static IServiceCollection AddJsonApi<TDbContext>(this IServiceCollection
2121
Action<ServiceDiscoveryFacade>? discovery = null, Action<ResourceGraphBuilder>? resources = null, IMvcCoreBuilder? mvcBuilder = null)
2222
where TDbContext : DbContext
2323
{
24-
return AddJsonApi(services, options, discovery, resources, mvcBuilder, [typeof(TDbContext)]);
24+
return services.AddJsonApi(options, discovery, resources, mvcBuilder, [typeof(TDbContext)]);
2525
}
2626

2727
/// <summary>

src/JsonApiDotNetCore/Queries/Expressions/AnyExpression.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ namespace JsonApiDotNetCore.Queries.Expressions;
1717
public class AnyExpression : FilterExpression
1818
{
1919
/// <summary>
20-
/// The attribute whose value to compare. Chain format: an optional list of to-one relationships, followed by an attribute.
20+
/// The function or attribute whose value to compare. Attribute chain format: an optional list of to-one relationships, followed by an attribute.
2121
/// </summary>
22-
public ResourceFieldChainExpression TargetAttribute { get; }
22+
public QueryExpression MatchTarget { get; }
2323

2424
/// <summary>
2525
/// One or more constants to compare the attribute's value against.
2626
/// </summary>
2727
public IImmutableSet<LiteralConstantExpression> Constants { get; }
2828

29-
public AnyExpression(ResourceFieldChainExpression targetAttribute, IImmutableSet<LiteralConstantExpression> constants)
29+
public AnyExpression(QueryExpression matchTarget, IImmutableSet<LiteralConstantExpression> constants)
3030
{
31-
ArgumentNullException.ThrowIfNull(targetAttribute);
31+
ArgumentNullException.ThrowIfNull(matchTarget);
3232
ArgumentGuard.NotNullNorEmpty(constants);
3333

34-
TargetAttribute = targetAttribute;
34+
MatchTarget = matchTarget;
3535
Constants = constants;
3636
}
3737

@@ -56,7 +56,7 @@ private string InnerToString(bool toFullString)
5656

5757
builder.Append(Keywords.Any);
5858
builder.Append('(');
59-
builder.Append(toFullString ? TargetAttribute.ToFullString() : TargetAttribute.ToString());
59+
builder.Append(toFullString ? MatchTarget.ToFullString() : MatchTarget.ToString());
6060
builder.Append(',');
6161
builder.Append(string.Join(',', Constants.Select(constant => toFullString ? constant.ToFullString() : constant.ToString()).Order()));
6262
builder.Append(')');
@@ -78,13 +78,13 @@ public override bool Equals(object? obj)
7878

7979
var other = (AnyExpression)obj;
8080

81-
return TargetAttribute.Equals(other.TargetAttribute) && Constants.SetEquals(other.Constants);
81+
return MatchTarget.Equals(other.MatchTarget) && Constants.SetEquals(other.Constants);
8282
}
8383

8484
public override int GetHashCode()
8585
{
8686
var hashCode = new HashCode();
87-
hashCode.Add(TargetAttribute);
87+
hashCode.Add(MatchTarget);
8888

8989
foreach (LiteralConstantExpression constant in Constants)
9090
{

src/JsonApiDotNetCore/Queries/Expressions/MatchTextExpression.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ namespace JsonApiDotNetCore.Queries.Expressions;
2424
public class MatchTextExpression : FilterExpression
2525
{
2626
/// <summary>
27-
/// The attribute whose value to match. Chain format: an optional list of to-one relationships, followed by an attribute.
27+
/// The function or attribute whose value to match. Attribute chain format: an optional list of to-one relationships, followed by an attribute.
2828
/// </summary>
29-
public ResourceFieldChainExpression TargetAttribute { get; }
29+
public QueryExpression MatchTarget { get; }
3030

3131
/// <summary>
32-
/// The text to match the attribute's value against.
32+
/// The text to match against.
3333
/// </summary>
3434
public LiteralConstantExpression TextValue { get; }
3535

@@ -38,12 +38,12 @@ public class MatchTextExpression : FilterExpression
3838
/// </summary>
3939
public TextMatchKind MatchKind { get; }
4040

41-
public MatchTextExpression(ResourceFieldChainExpression targetAttribute, LiteralConstantExpression textValue, TextMatchKind matchKind)
41+
public MatchTextExpression(QueryExpression matchTarget, LiteralConstantExpression textValue, TextMatchKind matchKind)
4242
{
43-
ArgumentNullException.ThrowIfNull(targetAttribute);
43+
ArgumentNullException.ThrowIfNull(matchTarget);
4444
ArgumentNullException.ThrowIfNull(textValue);
4545

46-
TargetAttribute = targetAttribute;
46+
MatchTarget = matchTarget;
4747
TextValue = textValue;
4848
MatchKind = matchKind;
4949
}
@@ -71,8 +71,8 @@ private string InnerToString(bool toFullString)
7171
builder.Append('(');
7272

7373
builder.Append(toFullString
74-
? string.Join(',', TargetAttribute.ToFullString(), TextValue.ToFullString())
75-
: string.Join(',', TargetAttribute.ToString(), TextValue.ToString()));
74+
? string.Join(',', MatchTarget.ToFullString(), TextValue.ToFullString())
75+
: string.Join(',', MatchTarget.ToString(), TextValue.ToString()));
7676

7777
builder.Append(')');
7878

@@ -93,11 +93,11 @@ public override bool Equals(object? obj)
9393

9494
var other = (MatchTextExpression)obj;
9595

96-
return TargetAttribute.Equals(other.TargetAttribute) && TextValue.Equals(other.TextValue) && MatchKind == other.MatchKind;
96+
return MatchTarget.Equals(other.MatchTarget) && TextValue.Equals(other.TextValue) && MatchKind == other.MatchKind;
9797
}
9898

9999
public override int GetHashCode()
100100
{
101-
return HashCode.Combine(TargetAttribute, TextValue, MatchKind);
101+
return HashCode.Combine(MatchTarget, TextValue, MatchKind);
102102
}
103103
}

src/JsonApiDotNetCore/Queries/Expressions/QueryExpressionRewriter.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ public override QueryExpression VisitPagination(PaginationExpression expression,
149149

150150
public override QueryExpression? VisitMatchText(MatchTextExpression expression, TArgument argument)
151151
{
152-
var newTargetAttribute = Visit(expression.TargetAttribute, argument) as ResourceFieldChainExpression;
152+
var newMatchTarget = Visit(expression.MatchTarget, argument) as ResourceFieldChainExpression;
153153
var newTextValue = Visit(expression.TextValue, argument) as LiteralConstantExpression;
154154

155-
if (newTargetAttribute != null && newTextValue != null)
155+
if (newMatchTarget != null && newTextValue != null)
156156
{
157-
var newExpression = new MatchTextExpression(newTargetAttribute, newTextValue, expression.MatchKind);
157+
var newExpression = new MatchTextExpression(newMatchTarget, newTextValue, expression.MatchKind);
158158
return newExpression.Equals(expression) ? expression : newExpression;
159159
}
160160

@@ -163,12 +163,12 @@ public override QueryExpression VisitPagination(PaginationExpression expression,
163163

164164
public override QueryExpression? VisitAny(AnyExpression expression, TArgument argument)
165165
{
166-
var newTargetAttribute = Visit(expression.TargetAttribute, argument) as ResourceFieldChainExpression;
166+
var newMatchTarget = Visit(expression.MatchTarget, argument) as ResourceFieldChainExpression;
167167
IImmutableSet<LiteralConstantExpression> newConstants = VisitSet(expression.Constants, argument);
168168

169-
if (newTargetAttribute != null)
169+
if (newMatchTarget != null)
170170
{
171-
var newExpression = new AnyExpression(newTargetAttribute, newConstants);
171+
var newExpression = new AnyExpression(newMatchTarget, newConstants);
172172
return newExpression.Equals(expression) ? expression : newExpression;
173173
}
174174

0 commit comments

Comments
 (0)