From 127e1dd845bf54ea305765088eedc6288a765f75 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 21 Feb 2026 13:06:52 +0100 Subject: [PATCH 01/14] Update to stable R# 2026.1.x --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index aaa49ac785..6f762ff5d1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "jetbrains.resharper.globaltools": { - "version": "2025.3.4", + "version": "2026.1.0.1", "commands": [ "jb" ], From 1eea12abaacef2e5e12f3a872dadcde86cd80050 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 01:17:49 +0200 Subject: [PATCH 02/14] R#: Switch to new setting to show SWEA warnings in IDE --- JsonApiDotNetCore.slnx.DotSettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index 4b9c881ac2..d954b8df1a 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -9,7 +9,6 @@ swagger.json SOLUTION True - True SUGGESTION SUGGESTION SUGGESTION @@ -96,6 +95,7 @@ SUGGESTION WARNING True + ShowAndRun SUGGESTION False <?xml version="1.0" encoding="utf-16"?><Profile name="JADNC Full Cleanup"><XMLReformatCode>True</XMLReformatCode><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" /><CssAlphabetizeProperties>True</CssAlphabetizeProperties><JsInsertSemicolon>True</JsInsertSemicolon><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CorrectVariableKindsDescriptor>True</CorrectVariableKindsDescriptor><VariablesToInnerScopesDescriptor>True</VariablesToInnerScopesDescriptor><StringToTemplatesDescriptor>True</StringToTemplatesDescriptor><JsReformatCode>True</JsReformatCode><JsFormatDocComments>True</JsFormatDocComments><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><OptimizeImportsTs>True</OptimizeImportsTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><AsInsteadOfCastTs>True</AsInsteadOfCastTs><HtmlReformatCode>True</HtmlReformatCode><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CssReformatCode>True</CssReformatCode><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSReorderTypeMembers>True</CSReorderTypeMembers><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><CSReformatInactiveBranches>True</CSReformatInactiveBranches><CSharpReformatComments>True</CSharpReformatComments></Profile> From ee7c27976c815bd216bc64536db3a2a008aae6e4 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 21 Feb 2026 13:22:18 +0100 Subject: [PATCH 03/14] Fixed R# warning: Convert into method group --- test/DiscoveryTests/ServiceDiscoveryFacadeTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/DiscoveryTests/ServiceDiscoveryFacadeTests.cs b/test/DiscoveryTests/ServiceDiscoveryFacadeTests.cs index 0b1fa3a8d3..2e0974da50 100644 --- a/test/DiscoveryTests/ServiceDiscoveryFacadeTests.cs +++ b/test/DiscoveryTests/ServiceDiscoveryFacadeTests.cs @@ -29,7 +29,7 @@ public void Can_add_resources_from_assembly_to_graph() Action addAction = facade => facade.AddAssembly(typeof(Person).Assembly); // Act - _services.AddJsonApi(discovery: facade => addAction(facade)); + _services.AddJsonApi(discovery: addAction); // Assert ServiceProvider serviceProvider = _services.BuildServiceProvider(); @@ -49,7 +49,7 @@ public void Can_add_resource_from_current_assembly_to_graph() Action addAction = facade => facade.AddCurrentAssembly(); // Act - _services.AddJsonApi(discovery: facade => addAction(facade)); + _services.AddJsonApi(discovery: addAction); // Assert ServiceProvider serviceProvider = _services.BuildServiceProvider(); @@ -66,7 +66,7 @@ public void Can_add_resource_service_from_current_assembly_to_container() Action addAction = facade => facade.AddCurrentAssembly(); // Act - _services.AddJsonApi(discovery: facade => addAction(facade)); + _services.AddJsonApi(discovery: addAction); // Assert ServiceProvider serviceProvider = _services.BuildServiceProvider(); @@ -82,7 +82,7 @@ public void Can_add_resource_repository_from_current_assembly_to_container() Action addAction = facade => facade.AddCurrentAssembly(); // Act - _services.AddJsonApi(discovery: facade => addAction(facade)); + _services.AddJsonApi(discovery: addAction); // Assert ServiceProvider serviceProvider = _services.BuildServiceProvider(); @@ -98,7 +98,7 @@ public void Can_add_resource_definition_from_current_assembly_to_container() Action addAction = facade => facade.AddCurrentAssembly(); // Act - _services.AddJsonApi(discovery: facade => addAction(facade)); + _services.AddJsonApi(discovery: addAction); // Assert ServiceProvider serviceProvider = _services.BuildServiceProvider(); From 0632221671fbb600612147bb2ea9ea396b37caab Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:10:06 +0100 Subject: [PATCH 04/14] Fixed R# warning: the nullable suppression is redundant --- .../AtomicOperations/Processors/AddToRelationshipProcessor.cs | 2 +- .../AtomicOperations/Processors/DeleteProcessor.cs | 3 --- .../Processors/RemoveFromRelationshipProcessor.cs | 2 +- .../AtomicOperations/Processors/SetRelationshipProcessor.cs | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs index e84756120a..6afe0cd518 100644 --- a/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs +++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs @@ -26,7 +26,7 @@ public AddToRelationshipProcessor(IAddToRelationshipService serv var leftId = (TId)operation.Resource.GetTypedId(); ISet rightResourceIds = operation.GetSecondaryResources(); - await _service.AddToToManyRelationshipAsync(leftId!, operation.Request.Relationship!.PublicName, rightResourceIds, cancellationToken); + await _service.AddToToManyRelationshipAsync(leftId, operation.Request.Relationship!.PublicName, rightResourceIds, cancellationToken); return null; } diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs index 406aca10b0..3212f17985 100644 --- a/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs +++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs @@ -24,10 +24,7 @@ public DeleteProcessor(IDeleteService service) ArgumentNullException.ThrowIfNull(operation); var id = (TId)operation.Resource.GetTypedId(); -#pragma warning disable CS8607 // A possible null value may not be used for a type marked with [NotNull] or [DisallowNull] - // Justification: Temporary workaround for R# bug at https://youtrack.jetbrains.com/issue/RSRP-503026. await _service.DeleteAsync(id, cancellationToken); -#pragma warning restore CS8607 // A possible null value may not be used for a type marked with [NotNull] or [DisallowNull] return null; } diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs index 81c4eb93ee..aef8be9626 100644 --- a/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs +++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs @@ -26,7 +26,7 @@ public RemoveFromRelationshipProcessor(IRemoveFromRelationshipService rightResourceIds = operation.GetSecondaryResources(); - await _service.RemoveFromToManyRelationshipAsync(leftId!, operation.Request.Relationship!.PublicName, rightResourceIds, cancellationToken); + await _service.RemoveFromToManyRelationshipAsync(leftId, operation.Request.Relationship!.PublicName, rightResourceIds, cancellationToken); return null; } diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs index 913068a26c..ec667ce6a4 100644 --- a/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs +++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs @@ -27,7 +27,7 @@ public SetRelationshipProcessor(ISetRelationshipService service) var leftId = (TId)operation.Resource.GetTypedId(); object? rightValue = GetRelationshipRightValue(operation); - await _service.SetRelationshipAsync(leftId!, operation.Request.Relationship!.PublicName, rightValue, cancellationToken); + await _service.SetRelationshipAsync(leftId, operation.Request.Relationship!.PublicName, rightValue, cancellationToken); return null; } From c042bc2d791b6c6b5976720c3987f2579a0c9f52 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 31 Mar 2026 01:06:41 +0200 Subject: [PATCH 05/14] R#: Auto-arrange property accessors on cleanup --- JsonApiDotNetCore.slnx.DotSettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index d954b8df1a..3ff54803b6 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -98,7 +98,7 @@ ShowAndRun SUGGESTION False - <?xml version="1.0" encoding="utf-16"?><Profile name="JADNC Full Cleanup"><XMLReformatCode>True</XMLReformatCode><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" /><CssAlphabetizeProperties>True</CssAlphabetizeProperties><JsInsertSemicolon>True</JsInsertSemicolon><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CorrectVariableKindsDescriptor>True</CorrectVariableKindsDescriptor><VariablesToInnerScopesDescriptor>True</VariablesToInnerScopesDescriptor><StringToTemplatesDescriptor>True</StringToTemplatesDescriptor><JsReformatCode>True</JsReformatCode><JsFormatDocComments>True</JsFormatDocComments><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><OptimizeImportsTs>True</OptimizeImportsTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><AsInsteadOfCastTs>True</AsInsteadOfCastTs><HtmlReformatCode>True</HtmlReformatCode><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CssReformatCode>True</CssReformatCode><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSReorderTypeMembers>True</CSReorderTypeMembers><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><CSReformatInactiveBranches>True</CSReformatInactiveBranches><CSharpReformatComments>True</CSharpReformatComments></Profile> + <?xml version="1.0" encoding="utf-16"?><Profile name="JADNC Full Cleanup"><XMLReformatCode>True</XMLReformatCode><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" ArrangeAccessors="True" /><CssAlphabetizeProperties>True</CssAlphabetizeProperties><JsInsertSemicolon>True</JsInsertSemicolon><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CorrectVariableKindsDescriptor>True</CorrectVariableKindsDescriptor><VariablesToInnerScopesDescriptor>True</VariablesToInnerScopesDescriptor><StringToTemplatesDescriptor>True</StringToTemplatesDescriptor><JsReformatCode>True</JsReformatCode><JsFormatDocComments>True</JsFormatDocComments><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><OptimizeImportsTs>True</OptimizeImportsTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><AsInsteadOfCastTs>True</AsInsteadOfCastTs><HtmlReformatCode>True</HtmlReformatCode><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CssReformatCode>True</CssReformatCode><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSReorderTypeMembers>True</CSReorderTypeMembers><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><CSReformatInactiveBranches>True</CSReformatInactiveBranches><CSharpReformatComments>True</CSharpReformatComments></Profile> JADNC Full Cleanup Required Required From 71b14c99cafcadc8c07847f125428f870d9ff6f3 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 31 Mar 2026 01:22:12 +0200 Subject: [PATCH 06/14] R#: Use string.Empty instead of "" --- JsonApiDotNetCore.slnx.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index 3ff54803b6..b300bc2fb2 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -16,6 +16,7 @@ SUGGESTION SUGGESTION SUGGESTION + WARNING SUGGESTION SUGGESTION SUGGESTION @@ -104,6 +105,7 @@ Required Required Required + StringEmpty Conditional False False From ff6852820cdbe3f4333974b90a3f19950867752a Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 01:25:04 +0200 Subject: [PATCH 07/14] Fixed R# warning: use string.Empty --- src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs | 2 +- src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs | 2 +- src/JsonApiDotNetCore/Serialization/Request/JsonApiReader.cs | 2 +- src/JsonApiDotNetCore/Serialization/Response/JsonApiWriter.cs | 2 +- .../IntegrationTests/QueryStrings/Sorting/SortTests.cs | 4 ++-- .../UnitTests/QueryStringParameters/PaginationParseTests.cs | 2 +- test/TestBuildingBlocks/XUnitLoggerProvider.cs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs b/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs index c29eed6301..621653188e 100644 --- a/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs +++ b/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs @@ -98,7 +98,7 @@ public async Task InvokeAsync(HttpContext httpContext, IJsonApiRequest request) if (CodeTimingSessionManager.IsEnabled && _logger.IsEnabled(LogLevel.Information)) { string timingResults = CodeTimingSessionManager.Current.GetResults(); - string requestMethod = httpContext.Request.Method.Replace(Environment.NewLine, ""); + string requestMethod = httpContext.Request.Method.Replace(Environment.NewLine, string.Empty); string requestUrl = httpContext.Request.GetEncodedUrl(); LogMeasurement(requestMethod, requestUrl, Environment.NewLine, timingResults); } diff --git a/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs index 68033328aa..f845f27943 100644 --- a/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs +++ b/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs @@ -48,7 +48,7 @@ public override string ToString() public override string ToFullString() { - return $"{string.Join(',', Elements.Select(child => child.ToFullString()))}{(IsAutoGenerated ? " (auto-generated)" : "")}"; + return $"{string.Join(',', Elements.Select(child => child.ToFullString()))}{(IsAutoGenerated ? " (auto-generated)" : string.Empty)}"; } public override bool Equals(object? obj) diff --git a/src/JsonApiDotNetCore/Serialization/Request/JsonApiReader.cs b/src/JsonApiDotNetCore/Serialization/Request/JsonApiReader.cs index 9c0139d949..3884960215 100644 --- a/src/JsonApiDotNetCore/Serialization/Request/JsonApiReader.cs +++ b/src/JsonApiDotNetCore/Serialization/Request/JsonApiReader.cs @@ -42,7 +42,7 @@ public JsonApiReader(IJsonApiOptions options, IDocumentAdapter documentAdapter, if (_logger.IsEnabled(LogLevel.Trace)) { - string requestMethod = httpRequest.Method.Replace(Environment.NewLine, ""); + string requestMethod = httpRequest.Method.Replace(Environment.NewLine, string.Empty); string requestUrl = httpRequest.GetEncodedUrl(); LogRequest(requestMethod, requestUrl, requestBody); } diff --git a/src/JsonApiDotNetCore/Serialization/Response/JsonApiWriter.cs b/src/JsonApiDotNetCore/Serialization/Response/JsonApiWriter.cs index 66dcaedf29..587c7b6d0b 100644 --- a/src/JsonApiDotNetCore/Serialization/Response/JsonApiWriter.cs +++ b/src/JsonApiDotNetCore/Serialization/Response/JsonApiWriter.cs @@ -65,7 +65,7 @@ public async Task WriteAsync(object? model, HttpContext httpContext) if (_logger.IsEnabled(LogLevel.Trace)) { - string requestMethod = httpContext.Request.Method.Replace(Environment.NewLine, ""); + string requestMethod = httpContext.Request.Method.Replace(Environment.NewLine, string.Empty); string requestUrl = httpContext.Request.GetEncodedUrl(); LogResponse(requestMethod, requestUrl, responseBody, httpContext.Response.StatusCode); } diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs index 413f18b91e..de556d5f9d 100644 --- a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs +++ b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs @@ -312,10 +312,10 @@ public async Task Can_sort_on_multiple_fields_in_multiple_scopes() blogs[0].Posts[1].Caption = "A"; blogs[0].Posts[2].Caption = "A"; blogs[0].Posts[3].Caption = "C"; - blogs[0].Posts[0].Url = ""; + blogs[0].Posts[0].Url = string.Empty; blogs[0].Posts[1].Url = "www.some2.com"; blogs[0].Posts[2].Url = "www.some1.com"; - blogs[0].Posts[3].Url = ""; + blogs[0].Posts[3].Url = string.Empty; blogs[0].Posts[0].Comments = _fakers.Comment.GenerateSet(3); blogs[0].Posts[0].Comments.ElementAt(0).CreatedAt = 1.January(2015).AsUtc(); diff --git a/test/JsonApiDotNetCoreTests/UnitTests/QueryStringParameters/PaginationParseTests.cs b/test/JsonApiDotNetCoreTests/UnitTests/QueryStringParameters/PaginationParseTests.cs index 9c102f5d15..9841e0fc47 100644 --- a/test/JsonApiDotNetCoreTests/UnitTests/QueryStringParameters/PaginationParseTests.cs +++ b/test/JsonApiDotNetCoreTests/UnitTests/QueryStringParameters/PaginationParseTests.cs @@ -182,7 +182,7 @@ public void Reader_Read_Pagination_Succeeds(string? pageNumber, string? pageSize ResourceFieldChainExpression?[] scopeTrees = constraints.Select(expressionInScope => expressionInScope.Scope).ToArray(); scopeTrees.Should().HaveSameCount(scopeTreesExpectedArray); - scopeTrees.Select(tree => tree?.ToString() ?? "").Should().BeEquivalentTo(scopeTreesExpectedArray, options => options.WithStrictOrdering()); + scopeTrees.Select(tree => tree?.ToString() ?? string.Empty).Should().BeEquivalentTo(scopeTreesExpectedArray, options => options.WithStrictOrdering()); string[] valueTreesExpectedArray = valueTreesExpected.Split("|"); QueryExpression[] valueTrees = constraints.Select(expressionInScope => expressionInScope.Expression).ToArray(); diff --git a/test/TestBuildingBlocks/XUnitLoggerProvider.cs b/test/TestBuildingBlocks/XUnitLoggerProvider.cs index 26c15d575b..b9eb8a366d 100644 --- a/test/TestBuildingBlocks/XUnitLoggerProvider.cs +++ b/test/TestBuildingBlocks/XUnitLoggerProvider.cs @@ -145,7 +145,7 @@ private static string GetLogLevelString(LogLevel logLevel) LogLevel.Warning => "WARN", LogLevel.Error => "FAIL", LogLevel.Critical => "CRIT", - LogLevel.None => "", + LogLevel.None => string.Empty, _ => throw new ArgumentOutOfRangeException(nameof(logLevel)) }; } From da85981d832000cd7dcd440826b07a86b8cb9438 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 01:29:28 +0200 Subject: [PATCH 08/14] R#: Disable notification about overload resolution change --- JsonApiDotNetCore.slnx.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index b300bc2fb2..5f897357e4 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -38,6 +38,7 @@ SUGGESTION SUGGESTION HINT + DO_NOT_SHOW WARNING WARNING WARNING From 68b115c81af912ead1a89ae6cef2b2629a031862 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 01:40:58 +0200 Subject: [PATCH 09/14] R#: Separate local function with return --- JsonApiDotNetCore.slnx.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index 5f897357e4..8f4c9b5181 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -79,6 +79,7 @@ WARNING WARNING DO_NOT_SHOW + DO_NOT_SHOW WARNING WARNING WARNING From dcba7c026c8fb87592d1b1d4f0f1a31f0797e923 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 31 Mar 2026 01:07:35 +0200 Subject: [PATCH 10/14] R#: Enforce using extension blocks --- JsonApiDotNetCore.slnx.DotSettings | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index 8f4c9b5181..c4905b4e4d 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -8,6 +8,7 @@ swagger.g.json swagger.json SOLUTION + True True SUGGESTION SUGGESTION @@ -37,6 +38,7 @@ WARNING SUGGESTION SUGGESTION + WARNING HINT DO_NOT_SHOW WARNING @@ -52,6 +54,7 @@ WARNING SUGGESTION HINT + WARNING DO_NOT_SHOW WARNING SUGGESTION @@ -62,6 +65,7 @@ SUGGESTION WARNING WARNING + WARNING WARNING SUGGESTION SUGGESTION From ce69ec455624b7f7affb27ab6f1de6ca5c13aaaf Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:02:13 +0200 Subject: [PATCH 11/14] Revert "R#: Enforce using extension blocks" This reverts commit e4d8ad443b28c0c9bc846c7d6ba7e1e5c443bfd9. --- JsonApiDotNetCore.slnx.DotSettings | 4 ---- 1 file changed, 4 deletions(-) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index c4905b4e4d..8f4c9b5181 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -8,7 +8,6 @@ swagger.g.json swagger.json SOLUTION - True True SUGGESTION SUGGESTION @@ -38,7 +37,6 @@ WARNING SUGGESTION SUGGESTION - WARNING HINT DO_NOT_SHOW WARNING @@ -54,7 +52,6 @@ WARNING SUGGESTION HINT - WARNING DO_NOT_SHOW WARNING SUGGESTION @@ -65,7 +62,6 @@ SUGGESTION WARNING WARNING - WARNING WARNING SUGGESTION SUGGESTION From efac1b9f32e69f7fbb4ec4cec46e1a9d701b7855 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:13:03 +0200 Subject: [PATCH 12/14] R#: Use range indexer --- JsonApiDotNetCore.slnx.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index 8f4c9b5181..d082c50790 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -77,6 +77,8 @@ WARNING SUGGESTION WARNING + WARNING + WARNING WARNING DO_NOT_SHOW DO_NOT_SHOW From d3439863a37e441fdd36112c85fb4cadc9396759 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:16:09 +0200 Subject: [PATCH 13/14] R#: Update member layout to new XML format --- JsonApiDotNetCore.slnx.DotSettings | 53 +++++++++++++++--------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/JsonApiDotNetCore.slnx.DotSettings b/JsonApiDotNetCore.slnx.DotSettings index d082c50790..8c39c0abcc 100644 --- a/JsonApiDotNetCore.slnx.DotSettings +++ b/JsonApiDotNetCore.slnx.DotSettings @@ -195,8 +195,7 @@ OnSingleLine False 160 - <?xml version="1.0" encoding="utf-16"?> -<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> + <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> <TypePattern DisplayName="Non-reorderable types" RemoveRegions="All"> <TypePattern.Match> <Or> @@ -220,7 +219,7 @@ <HasMember> <And> <Kind Is="Method" /> - <HasAttribute Name="Xunit.FactAttribute" Inherited="True" /> + <HasAttribute Inherited="True" Name="Xunit.FactAttribute" /> </And> </HasMember> </And> @@ -232,7 +231,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Group DisplayName="Fields"> @@ -245,7 +244,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Static"> @@ -259,7 +258,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance Readonly"> @@ -273,7 +272,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance"> @@ -289,7 +288,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> </Group> @@ -302,7 +301,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance"> @@ -315,7 +314,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> </Group> @@ -326,7 +325,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Group DisplayName="Events"> @@ -338,7 +337,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance"> @@ -351,7 +350,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> </Group> @@ -366,7 +365,7 @@ </Or> </Entry.Match> <Entry.SortBy> - <Kind Order="Constructor" /> + <Kind Is="0" Order="Constructor" /> </Entry.SortBy> </Entry> <Entry DisplayName="Test methods" Priority="100"> @@ -397,7 +396,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Nested types"> @@ -414,7 +413,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Group DisplayName="Fields"> @@ -427,7 +426,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Static"> @@ -441,7 +440,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance Readonly"> @@ -455,7 +454,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance"> @@ -471,7 +470,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> </Group> @@ -484,7 +483,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance"> @@ -497,7 +496,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> </Group> @@ -508,7 +507,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Group DisplayName="Events"> @@ -520,7 +519,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Instance"> @@ -533,7 +532,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> </Group> @@ -556,7 +555,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access /> + <Access Is="0" /> </Entry.SortBy> </Entry> </Group> @@ -577,7 +576,7 @@ </And> </Entry.Match> <Entry.SortBy> - <Access Order="Private Internal Protected ProtectedInternal Public" /> + <Access Is="0" Order="Private Internal Protected ProtectedInternal Public" /> </Entry.SortBy> </Entry> <Entry DisplayName="Nested types"> From 6c971df3477e300087bfa398743fb91f58f9d6de Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:23:49 +0200 Subject: [PATCH 14/14] Fix CA1830: Prefer strongly-typed StringBuilder overload --- .../DapperExample/TranslationToSql/Builders/SqlQueryBuilder.cs | 2 +- src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs | 2 +- src/JsonApiDotNetCore/Queries/IndentingStringWriter.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Examples/DapperExample/TranslationToSql/Builders/SqlQueryBuilder.cs b/src/Examples/DapperExample/TranslationToSql/Builders/SqlQueryBuilder.cs index 5d3fc634da..ec8d360087 100644 --- a/src/Examples/DapperExample/TranslationToSql/Builders/SqlQueryBuilder.cs +++ b/src/Examples/DapperExample/TranslationToSql/Builders/SqlQueryBuilder.cs @@ -452,7 +452,7 @@ private void AppendOnNewLine(string? value, StringBuilder builder) builder.AppendLine(); } - builder.Append(new string(' ', _indentDepth * 4)); + builder.Append(' ', _indentDepth * 4); builder.Append(value); } } diff --git a/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs b/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs index 48109b4c98..6a3fbbf676 100644 --- a/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs +++ b/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs @@ -263,7 +263,7 @@ private void WriteResult(StringBuilder builder, int indent, TimeSpan timeElapsed private static void WriteIndent(StringBuilder builder, int indent) { - builder.Append(new string(' ', indent * 2)); + builder.Append(' ', indent * 2); } private void WritePadding(StringBuilder builder, int indent, int paddingLength) diff --git a/src/JsonApiDotNetCore/Queries/IndentingStringWriter.cs b/src/JsonApiDotNetCore/Queries/IndentingStringWriter.cs index e5f39b6c77..bdb49ccdf0 100644 --- a/src/JsonApiDotNetCore/Queries/IndentingStringWriter.cs +++ b/src/JsonApiDotNetCore/Queries/IndentingStringWriter.cs @@ -12,7 +12,7 @@ public void WriteLine(string? line) { if (_indentDepth > 0) { - _builder.Append(new string(' ', _indentDepth * 2)); + _builder.Append(' ', _indentDepth * 2); } _builder.AppendLine(line);