From bb9f3c3a8d72d6e24da7edad211b442f1ce9e997 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 23 Sep 2023 13:46:07 +0200
Subject: [PATCH 01/53] Count/Length consistency
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a796be61f0..c56a9dafbb 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -99,7 +99,7 @@ jobs:
# Get the version prefix/suffix from the git tag. For example: 'v1.0.0-preview1-final' => '1.0.0' and 'preview1-final'
$segments = $env:GITHUB_REF_NAME -split "-"
$versionPrefix = $segments[0].TrimStart('v')
- $versionSuffix = $segments.Count -eq 1 ? '' : $segments[1..$($segments.Length-1)] -join '-'
+ $versionSuffix = $segments.Length -eq 1 ? '' : $segments[1..$($segments.Length - 1)] -join '-'
[xml]$xml = Get-Content Directory.Build.props
$configuredVersionPrefix = $xml.Project.PropertyGroup[0].JsonApiDotNetCoreVersionPrefix
From 88d7814ae84e02d549c5b7bd2bb1b479ce0ac269 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 23 Sep 2023 13:46:31 +0200
Subject: [PATCH 02/53] Increment version to 5.4.1 (used for pre-release builds
from ci)
---
Directory.Build.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 1c96340f4f..15fb0782a1 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -6,7 +6,7 @@
7.0.*
4.7.*
2.14.1
- 5.4.0
+ 5.4.1
$(MSBuildThisFileDirectory)CodingGuidelines.ruleset
9999
enable
From 091fa288a95706d4a042b2bff06b89731e6795a2 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sun, 24 Sep 2023 22:51:18 +0200
Subject: [PATCH 03/53] GitHub Actions: Clear version suffix when set in
project files
Using MSBuild property because the `-version-suffix` switch does not accept null or an empty string
---
.github/workflows/build.yml | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c56a9dafbb..4de5a74b39 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -124,12 +124,7 @@ jobs:
- name: Build
shell: pwsh
run: |
- if ($env:PACKAGE_VERSION_SUFFIX) {
- dotnet build --no-restore --configuration Release --version-suffix=$env:PACKAGE_VERSION_SUFFIX
- }
- else {
- dotnet build --no-restore --configuration Release
- }
+ dotnet build --no-restore --configuration Release /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
- name: Test
run: |
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true" -- RunConfiguration.CollectSourceInformation=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true
@@ -139,12 +134,7 @@ jobs:
- name: Generate packages
shell: pwsh
run: |
- if ($env:PACKAGE_VERSION_SUFFIX) {
- dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages --version-suffix=$env:PACKAGE_VERSION_SUFFIX
- }
- else {
- dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages
- }
+ dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
- name: Upload packages to artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
From 883422f334a4dc4e905699173059319974ed1ad3 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Mon, 25 Sep 2023 00:09:28 +0200
Subject: [PATCH 04/53] Use centralized versions in all package references;
split into breaking and non-breaking (floating) version sets
---
Directory.Build.props | 68 +++++++++++--------
benchmarks/Benchmarks.csproj | 4 +-
.../DatabasePerTenantExample.csproj | 4 +-
.../GettingStarted/GettingStarted.csproj | 2 +-
.../JsonApiDotNetCoreExample.csproj | 4 +-
.../MultiDbContextExample.csproj | 2 +-
.../NoEntityFrameworkExample.csproj | 2 +-
.../ReportsExample/ReportsExample.csproj | 4 +-
.../JsonApiDotNetCore.Annotations.csproj | 4 +-
.../JsonApiDotNetCore.SourceGenerators.csproj | 4 +-
.../JsonApiDotNetCore.csproj | 12 ++--
.../JsonApiDotNetCoreTests.csproj | 10 +--
.../MultiDbContextTests.csproj | 2 +-
.../NoEntityFrameworkTests.csproj | 2 +-
.../SourceGeneratorTests.csproj | 2 +-
.../TestBuildingBlocks.csproj | 14 ++--
test/UnitTests/UnitTests.csproj | 2 +-
17 files changed, 78 insertions(+), 64 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 15fb0782a1..75d754d5bc 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,28 +1,6 @@
-
- net6.0
- 6.0.*
- 7.0.*
- 7.0.*
- 4.7.*
- 2.14.1
- 5.4.1
- $(MSBuildThisFileDirectory)CodingGuidelines.ruleset
- 9999
- enable
- enable
- false
- false
-
-
-
-
-
-
-
-
-
- true
+
+ $(NoWarn);AV2210
@@ -31,14 +9,50 @@
true
-
- $(NoWarn);AV2210
+
+ true
-
+
+ net6.0
+ 4.1.0
+ 0.4.1
+ 6.0.0
+ 2.14.1
+
+
+ 6.0.*
+ 0.13.*
+ 34.0.*
+ 3.8.*
+ 4.7.*
6.0.*
+ 2.1.*
+ 7.0.*
+ 6.12.*
2.3.*
+ 1.3.*
+ 2023.2.*
+ 7.0.*
+ 1.1.*
+ 7.0.*
17.7.*
+ 2.5.*
+
+
+
+
+
+
+
+
+
+ enable
+ enable
+ false
+ false
+ $(MSBuildThisFileDirectory)CodingGuidelines.ruleset
+ 5.4.1
diff --git a/benchmarks/Benchmarks.csproj b/benchmarks/Benchmarks.csproj
index 23a6876af9..1e97dd290f 100644
--- a/benchmarks/Benchmarks.csproj
+++ b/benchmarks/Benchmarks.csproj
@@ -10,8 +10,8 @@
-
-
+
+
diff --git a/src/Examples/DatabasePerTenantExample/DatabasePerTenantExample.csproj b/src/Examples/DatabasePerTenantExample/DatabasePerTenantExample.csproj
index a48f472a70..c219dfd0f5 100644
--- a/src/Examples/DatabasePerTenantExample/DatabasePerTenantExample.csproj
+++ b/src/Examples/DatabasePerTenantExample/DatabasePerTenantExample.csproj
@@ -10,7 +10,7 @@
-
-
+
+
diff --git a/src/Examples/GettingStarted/GettingStarted.csproj b/src/Examples/GettingStarted/GettingStarted.csproj
index ab152b79d5..9e0c80b7f4 100644
--- a/src/Examples/GettingStarted/GettingStarted.csproj
+++ b/src/Examples/GettingStarted/GettingStarted.csproj
@@ -10,6 +10,6 @@
-
+
diff --git a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
index a48f472a70..c219dfd0f5 100644
--- a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
+++ b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
@@ -10,7 +10,7 @@
-
-
+
+
diff --git a/src/Examples/MultiDbContextExample/MultiDbContextExample.csproj b/src/Examples/MultiDbContextExample/MultiDbContextExample.csproj
index ab152b79d5..9e0c80b7f4 100644
--- a/src/Examples/MultiDbContextExample/MultiDbContextExample.csproj
+++ b/src/Examples/MultiDbContextExample/MultiDbContextExample.csproj
@@ -10,6 +10,6 @@
-
+
diff --git a/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj b/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj
index 9f0037b058..e272b4fcbf 100644
--- a/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj
+++ b/src/Examples/NoEntityFrameworkExample/NoEntityFrameworkExample.csproj
@@ -10,6 +10,6 @@
-
+
diff --git a/src/Examples/ReportsExample/ReportsExample.csproj b/src/Examples/ReportsExample/ReportsExample.csproj
index a48f472a70..c219dfd0f5 100644
--- a/src/Examples/ReportsExample/ReportsExample.csproj
+++ b/src/Examples/ReportsExample/ReportsExample.csproj
@@ -10,7 +10,7 @@
-
-
+
+
diff --git a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
index 119d295b35..48ca676b4a 100644
--- a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
+++ b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
@@ -46,7 +46,7 @@
-
-
+
+
diff --git a/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj b/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
index 6d79d8c893..ca6de1a5b7 100644
--- a/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
+++ b/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
@@ -45,7 +45,7 @@
-
-
+
+
diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
index 6a1b8517e6..4407edaf1f 100644
--- a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
+++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
@@ -36,11 +36,11 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/test/JsonApiDotNetCoreTests/JsonApiDotNetCoreTests.csproj b/test/JsonApiDotNetCoreTests/JsonApiDotNetCoreTests.csproj
index e66fbaeacc..7a3fa8ddf8 100644
--- a/test/JsonApiDotNetCoreTests/JsonApiDotNetCoreTests.csproj
+++ b/test/JsonApiDotNetCoreTests/JsonApiDotNetCoreTests.csproj
@@ -11,12 +11,12 @@
-
+
-
-
-
+
+
+
-
+
diff --git a/test/MultiDbContextTests/MultiDbContextTests.csproj b/test/MultiDbContextTests/MultiDbContextTests.csproj
index 0f5f5f2cff..394d72e2d2 100644
--- a/test/MultiDbContextTests/MultiDbContextTests.csproj
+++ b/test/MultiDbContextTests/MultiDbContextTests.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj b/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj
index f651f73c0e..84a36dcbb1 100644
--- a/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj
+++ b/test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/test/SourceGeneratorTests/SourceGeneratorTests.csproj b/test/SourceGeneratorTests/SourceGeneratorTests.csproj
index 707de9b8c5..d361de38e5 100644
--- a/test/SourceGeneratorTests/SourceGeneratorTests.csproj
+++ b/test/SourceGeneratorTests/SourceGeneratorTests.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/test/TestBuildingBlocks/TestBuildingBlocks.csproj b/test/TestBuildingBlocks/TestBuildingBlocks.csproj
index 386e4e846e..ba9a2f5da3 100644
--- a/test/TestBuildingBlocks/TestBuildingBlocks.csproj
+++ b/test/TestBuildingBlocks/TestBuildingBlocks.csproj
@@ -8,15 +8,15 @@
-
+
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/test/UnitTests/UnitTests.csproj b/test/UnitTests/UnitTests.csproj
index 85bcc57484..f8dcbce984 100644
--- a/test/UnitTests/UnitTests.csproj
+++ b/test/UnitTests/UnitTests.csproj
@@ -10,7 +10,7 @@
-
+
From 2f93f4337e544a4ec12cc689e81fd662f924127f Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Mon, 25 Sep 2023 00:30:51 +0200
Subject: [PATCH 05/53] Fix build failure on empty version suffix
---
Build.ps1 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Build.ps1 b/Build.ps1
index 4f0912079d..4854651d67 100644
--- a/Build.ps1
+++ b/Build.ps1
@@ -1,3 +1,5 @@
+$versionSuffix="pre"
+
function VerifySuccessExitCode {
if ($LastExitCode -ne 0) {
throw "Command failed with exit code $LastExitCode."
@@ -6,11 +8,12 @@ function VerifySuccessExitCode {
Write-Host "$(pwsh --version)"
Write-Host "Active .NET SDK: $(dotnet --version)"
+Write-Host "Using version suffix: $versionSuffix"
dotnet tool restore
VerifySuccessExitCode
-dotnet build --configuration Release --version-suffix="pre"
+dotnet build --configuration Release /p:VersionSuffix=$versionSuffix
VerifySuccessExitCode
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true
@@ -19,5 +22,5 @@ VerifySuccessExitCode
dotnet reportgenerator -reports:**\coverage.cobertura.xml -targetdir:artifacts\coverage -filefilters:-*.g.cs
VerifySuccessExitCode
-dotnet pack --no-build --configuration Release --output artifacts/packages --version-suffix="pre"
+dotnet pack --no-build --configuration Release --output artifacts/packages /p:VersionSuffix=$versionSuffix
VerifySuccessExitCode
From 9f5cd9d28ff570c9eb6c914a28a42eb4e9477d85 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Tue, 26 Sep 2023 02:00:27 +0200
Subject: [PATCH 06/53] GitHub Actions build: fix version detection
---
.github/workflows/build.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4de5a74b39..1dc9384515 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -102,7 +102,7 @@ jobs:
$versionSuffix = $segments.Length -eq 1 ? '' : $segments[1..$($segments.Length - 1)] -join '-'
[xml]$xml = Get-Content Directory.Build.props
- $configuredVersionPrefix = $xml.Project.PropertyGroup[0].JsonApiDotNetCoreVersionPrefix
+ $configuredVersionPrefix = $xml.Project.PropertyGroup.JsonApiDotNetCoreVersionPrefix | Select-Object -First 1
if ($configuredVersionPrefix -ne $versionPrefix) {
Write-Error "Version prefix from git release tag '$versionPrefix' does not match version prefix '$configuredVersionPrefix' stored in Directory.Build.props."
# To recover from this:
From 2c6b3159c165e7500ce0cafaf019d03941eedfb7 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Wed, 27 Sep 2023 00:37:06 +0200
Subject: [PATCH 07/53] GitHub Actions: scan for vulnerable dependencies in
pull requests (#1345)
---
.github/workflows/deps-review.yml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 .github/workflows/deps-review.yml
diff --git a/.github/workflows/deps-review.yml b/.github/workflows/deps-review.yml
new file mode 100644
index 0000000000..b9945082d5
--- /dev/null
+++ b/.github/workflows/deps-review.yml
@@ -0,0 +1,14 @@
+name: 'Dependency Review'
+on: [pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ dependency-review:
+ runs-on: ubuntu-latest
+ steps:
+ - name: 'Checkout Repository'
+ uses: actions/checkout@v4
+ - name: 'Dependency Review'
+ uses: actions/dependency-review-action@v3
From f5d4b520d65156f150bc9314ac7af8a6bfb4b16e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 27 Sep 2023 08:51:16 +0000
Subject: [PATCH 08/53] Bump jetbrains.resharper.globaltools from 2023.2.1 to
2023.2.2 (#1346)
---
.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 3919f2223e..369dfb58c2 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
- "version": "2023.2.1",
+ "version": "2023.2.2",
"commands": [
"jb"
]
From 93f83c388f2a644d7203401c146e11a79388773a Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Fri, 29 Sep 2023 00:33:52 +0200
Subject: [PATCH 09/53] Provide additional links when creating new issue
---
.github/ISSUE_TEMPLATE/bug_report.md | 2 +-
.github/ISSUE_TEMPLATE/config.yml | 14 ++++++++++++++
.github/ISSUE_TEMPLATE/feature_request.md | 2 +-
.github/ISSUE_TEMPLATE/question.md | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
create mode 100644 .github/ISSUE_TEMPLATE/config.yml
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index c59acf46d6..02e871bd7c 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,6 +1,6 @@
---
name: Bug report
-about: Create a report to help us improve
+about: Create a report to help us improve.
title: ''
labels: 'bug'
assignees: ''
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..8bf0a9112f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,14 @@
+blank_issues_enabled: true
+contact_links:
+- name: Documentation
+ url: https://www.jsonapi.net/usage/resources/index.html
+ about: Read our comprehensive documentation.
+- name: Sponsor JsonApiDotNetCore
+ url: https://github.com/sponsors/json-api-dotnet
+ about: Help the continued development.
+- name: Ask on Gitter
+ url: https://gitter.im/json-api-dotnet-core/Lobby
+ about: Get in touch with the whole community.
+- name: Ask on Stack Overflow
+ url: https://stackoverflow.com/questions/tagged/json-api
+ about: The best place for asking general-purpose questions.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index f629ca472d..019f7a9767 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,6 +1,6 @@
---
name: Feature request
-about: Suggest an idea for this project
+about: Suggest an idea for this project.
title: ''
labels: 'enhancement'
assignees: ''
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
index 51304f7f03..3e3c1ba085 100644
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -1,6 +1,6 @@
---
name: Question
-about: Ask a question
+about: Ask a question.
title: ''
labels: 'question'
assignees: ''
From 507851e1a7ba069aaf3f99092f1c7f656e7d4e7b Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Fri, 29 Sep 2023 18:59:23 +0200
Subject: [PATCH 10/53] Removed incomplete and abandoned related project
---
README.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 90bb47b405..fe2658711f 100644
--- a/README.md
+++ b/README.md
@@ -34,8 +34,7 @@ These are some steps you can take to help you understand what this project is an
- [Performance Reports](https://github.com/json-api-dotnet/PerformanceReports)
- [JsonApiDotNetCore.MongoDb](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb)
-- [JsonApiDotNetCore.Marten](https://github.com/wayne-o/JsonApiDotNetCore.Marten)
-- [Todo List App](https://github.com/json-api-dotnet/TodoListExample)
+- [Ember.js Todo List App](https://github.com/json-api-dotnet/TodoListExample)
## Examples
From a37ca56d94726fab0150f659c678bea85241333a Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sun, 1 Oct 2023 22:44:21 +0200
Subject: [PATCH 11/53] Minor refactorings on string interpolation and verbatim
strings
---
src/JsonApiDotNetCore/Middleware/HeaderConstants.cs | 2 +-
.../ModelState/ModelStateValidationTests.cs | 4 ++--
.../NamingConventions/KebabCasingTests.cs | 4 ++--
.../NamingConventions/PascalCasingTests.cs | 2 +-
.../Pagination/PaginationWithTotalCountTests.cs | 4 ++--
.../ReadWrite/Creating/CreateResourceTests.cs | 2 +-
.../ReadWrite/Fetching/FetchResourceTests.cs | 2 +-
.../Queries/QueryExpressionRewriterTests.cs | 12 ++++++------
.../CreateSortExpressionFromLambdaTests.cs | 2 +-
9 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs b/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs
index 43a5989d59..d290ba80eb 100644
--- a/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs
+++ b/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs
@@ -8,5 +8,5 @@ namespace JsonApiDotNetCore.Middleware;
public static class HeaderConstants
{
public const string MediaType = "application/vnd.api+json";
- public const string AtomicOperationsMediaType = MediaType + "; ext=\"https://jsonapi.org/ext/atomic\"";
+ public const string AtomicOperationsMediaType = $"{MediaType}; ext=\"https://jsonapi.org/ext/atomic\"";
}
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs
index 5a0738b0a9..9e104eef01 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs
@@ -125,7 +125,7 @@ public async Task Cannot_create_resource_with_invalid_attribute_value()
ErrorObject error = responseDocument.Errors[0];
error.StatusCode.Should().Be(HttpStatusCode.UnprocessableEntity);
error.Title.Should().Be("Input validation failed.");
- error.Detail.Should().Be("The field Name must match the regular expression '^[\\w\\s]+$'.");
+ error.Detail.Should().Be(@"The field Name must match the regular expression '^[\w\s]+$'.");
error.Source.ShouldNotBeNull();
error.Source.Pointer.Should().Be("/data/attributes/directoryName");
}
@@ -534,7 +534,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
ErrorObject error = responseDocument.Errors[0];
error.StatusCode.Should().Be(HttpStatusCode.UnprocessableEntity);
error.Title.Should().Be("Input validation failed.");
- error.Detail.Should().Be("The field Name must match the regular expression '^[\\w\\s]+$'.");
+ error.Detail.Should().Be(@"The field Name must match the regular expression '^[\w\s]+$'.");
error.Source.ShouldNotBeNull();
error.Source.Pointer.Should().Be("/data/attributes/directoryName");
}
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/KebabCasingTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/KebabCasingTests.cs
index d70f50de0e..f7d407696e 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/KebabCasingTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/KebabCasingTests.cs
@@ -74,8 +74,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- string route = $"/public-api/swimming-pools/{pool.StringId}/water-slides" +
- "?filter=greaterThan(length-in-meters,'1')&fields[water-slides]=length-in-meters";
+ string route =
+ $"/public-api/swimming-pools/{pool.StringId}/water-slides?filter=greaterThan(length-in-meters,'1')&fields[water-slides]=length-in-meters";
// Act
(HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync(route);
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/PascalCasingTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/PascalCasingTests.cs
index 59d442fcba..9f71d9de16 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/PascalCasingTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/NamingConventions/PascalCasingTests.cs
@@ -79,7 +79,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- string route = $"/PublicApi/SwimmingPools/{pool.StringId}/WaterSlides" + "?filter=greaterThan(LengthInMeters,'1')&fields[WaterSlides]=LengthInMeters";
+ string route = $"/PublicApi/SwimmingPools/{pool.StringId}/WaterSlides?filter=greaterThan(LengthInMeters,'1')&fields[WaterSlides]=LengthInMeters";
// Act
(HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync(route);
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs
index ad6f8a1609..d2163d95cd 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs
@@ -323,10 +323,10 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Links.ShouldNotBeNull();
responseDocument.Links.Self.Should().Be($"{HostPrefix}{route}");
- responseDocument.Links.First.Should().Be(basePath + "?page%5Bsize%5D=1");
+ responseDocument.Links.First.Should().Be($"{basePath}?page%5Bsize%5D=1");
responseDocument.Links.Last.Should().BeNull();
responseDocument.Links.Prev.Should().Be(responseDocument.Links.First);
- responseDocument.Links.Next.Should().Be(basePath + "?page%5Bnumber%5D=3&page%5Bsize%5D=1");
+ responseDocument.Links.Next.Should().Be($"{basePath}?page%5Bnumber%5D=3&page%5Bsize%5D=1");
}
[Fact]
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs
index 3354afd6bb..5f1f894a9b 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs
@@ -684,7 +684,7 @@ public async Task Cannot_create_resource_on_unknown_resource_type_in_url()
}
};
- const string route = "/" + Unknown.ResourceType;
+ const string route = $"/{Unknown.ResourceType}";
// Act
(HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecutePostAsync(route, requestBody);
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs
index 487c6d72d5..853e09d95c 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs
@@ -62,7 +62,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
public async Task Cannot_get_primary_resources_for_unknown_type()
{
// Arrange
- const string route = "/" + Unknown.ResourceType;
+ const string route = $"/{Unknown.ResourceType}";
// Act
(HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecuteGetAsync(route);
diff --git a/test/JsonApiDotNetCoreTests/UnitTests/Queries/QueryExpressionRewriterTests.cs b/test/JsonApiDotNetCoreTests/UnitTests/Queries/QueryExpressionRewriterTests.cs
index 3e4a6b2276..3d2d8faa85 100644
--- a/test/JsonApiDotNetCoreTests/UnitTests/Queries/QueryExpressionRewriterTests.cs
+++ b/test/JsonApiDotNetCoreTests/UnitTests/Queries/QueryExpressionRewriterTests.cs
@@ -53,7 +53,7 @@ public void VisitInclude(string expressionText, string expectedTypes)
// Assert
List visitedTypeNames = rewriter.ExpressionsVisited.Select(queryExpression => queryExpression.GetType().Name).ToList();
- List expectedTypeNames = expectedTypes.Split(',').Select(type => type + "Expression").ToList();
+ List expectedTypeNames = expectedTypes.Split(',').Select(type => $"{type}Expression").ToList();
visitedTypeNames.Should().ContainInOrder(expectedTypeNames);
visitedTypeNames.Should().HaveCount(expectedTypeNames.Count);
@@ -76,7 +76,7 @@ public void VisitSparseFieldSet(string expressionText, string expectedTypes)
// Assert
List visitedTypeNames = rewriter.ExpressionsVisited.Select(queryExpression => queryExpression.GetType().Name).ToList();
- List expectedTypeNames = expectedTypes.Split(',').Select(type => type + "Expression").ToList();
+ List expectedTypeNames = expectedTypes.Split(',').Select(type => $"{type}Expression").ToList();
visitedTypeNames.Should().ContainInOrder(expectedTypeNames);
visitedTypeNames.Should().HaveCount(expectedTypeNames.Count);
@@ -136,7 +136,7 @@ public void VisitFilter(string expressionText, string expectedTypes)
// Assert
List visitedTypeNames = rewriter.ExpressionsVisited.Select(queryExpression => queryExpression.GetType().Name).ToList();
- List expectedTypeNames = expectedTypes.Split(',').Select(type => type + "Expression").ToList();
+ List expectedTypeNames = expectedTypes.Split(',').Select(type => $"{type}Expression").ToList();
visitedTypeNames.Should().ContainInOrder(expectedTypeNames);
visitedTypeNames.Should().HaveCount(expectedTypeNames.Count);
@@ -160,7 +160,7 @@ public void VisitSort(string expressionText, string expectedTypes)
// Assert
List visitedTypeNames = rewriter.ExpressionsVisited.Select(queryExpression => queryExpression.GetType().Name).ToList();
- List expectedTypeNames = expectedTypes.Split(',').Select(type => type + "Expression").ToList();
+ List expectedTypeNames = expectedTypes.Split(',').Select(type => $"{type}Expression").ToList();
visitedTypeNames.Should().ContainInOrder(expectedTypeNames);
visitedTypeNames.Should().HaveCount(expectedTypeNames.Count);
@@ -183,7 +183,7 @@ public void VisitPagination(string expressionText, string expectedTypes)
// Assert
List visitedTypeNames = rewriter.ExpressionsVisited.Select(queryExpression => queryExpression.GetType().Name).ToList();
- List expectedTypeNames = expectedTypes.Split(',').Select(type => type + "Expression").ToList();
+ List expectedTypeNames = expectedTypes.Split(',').Select(type => $"{type}Expression").ToList();
visitedTypeNames.Should().ContainInOrder(expectedTypeNames);
visitedTypeNames.Should().HaveCount(expectedTypeNames.Count);
@@ -208,7 +208,7 @@ public void VisitParameterScope(string expressionText, string expectedTypes)
// Assert
List visitedTypeNames = rewriter.ExpressionsVisited.Select(queryExpression => queryExpression.GetType().Name).ToList();
- List expectedTypeNames = expectedTypes.Split(',').Select(type => type + "Expression").ToList();
+ List expectedTypeNames = expectedTypes.Split(',').Select(type => $"{type}Expression").ToList();
visitedTypeNames.Should().ContainInOrder(expectedTypeNames);
visitedTypeNames.Should().HaveCount(expectedTypeNames.Count);
diff --git a/test/JsonApiDotNetCoreTests/UnitTests/ResourceDefinitions/CreateSortExpressionFromLambdaTests.cs b/test/JsonApiDotNetCoreTests/UnitTests/ResourceDefinitions/CreateSortExpressionFromLambdaTests.cs
index 3d178073c7..8b919a87cc 100644
--- a/test/JsonApiDotNetCoreTests/UnitTests/ResourceDefinitions/CreateSortExpressionFromLambdaTests.cs
+++ b/test/JsonApiDotNetCoreTests/UnitTests/ResourceDefinitions/CreateSortExpressionFromLambdaTests.cs
@@ -317,7 +317,7 @@ public void Cannot_convert_concatenation_operator()
// Act
Action action = () => resourceDefinition.GetSortExpressionFromLambda(new JsonApiResourceDefinition.PropertySortOrder
{
- (file => file.Name + ":" + file.Content, ListSortDirection.Ascending)
+ (file => $"{file.Name}:{file.Content}", ListSortDirection.Ascending)
});
// Assert
From 92e6d45a2f60820ffb864b6067cb340805658908 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sun, 1 Oct 2023 22:45:14 +0200
Subject: [PATCH 12/53] Simplify test assertions
---
.../SparseFieldSets/SparseFieldSetTests.cs | 30 +++++++++----------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs
index 44148b19e7..2dacb19ea7 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs
@@ -71,7 +71,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Caption.Should().Be(post.Caption);
postCaptured.Url.Should().BeNull();
}
@@ -106,7 +106,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("caption").With(value => value.Should().Be(post.Caption));
responseDocument.Data.ManyValue[0].Relationships.Should().BeNull();
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Caption.Should().Be(post.Caption);
postCaptured.Url.Should().BeNull();
}
@@ -149,7 +149,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Caption.Should().BeNull();
postCaptured.Url.Should().BeNull();
}
@@ -193,7 +193,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single();
+ var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).Which;
blogCaptured.Id.Should().Be(blog.Id);
blogCaptured.Title.Should().BeNull();
@@ -240,7 +240,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Url.Should().Be(post.Url);
postCaptured.Caption.Should().BeNull();
}
@@ -299,7 +299,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Id.Should().Be(post.Id);
postCaptured.Caption.Should().Be(post.Caption);
@@ -361,7 +361,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var accountCaptured = (WebAccount)store.Resources.Should().ContainSingle(resource => resource is WebAccount).And.Subject.Single();
+ var accountCaptured = (WebAccount)store.Resources.Should().ContainSingle(resource => resource is WebAccount).Which;
accountCaptured.Id.Should().Be(account.Id);
accountCaptured.DisplayName.Should().Be(account.DisplayName);
@@ -423,7 +423,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single();
+ var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).Which;
blogCaptured.Id.Should().Be(blog.Id);
blogCaptured.Owner.ShouldNotBeNull();
blogCaptured.Owner.DisplayName.Should().Be(blog.Owner.DisplayName);
@@ -476,7 +476,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Included[0].Attributes.ShouldContainKey("color").With(value => value.Should().Be(post.Labels.Single().Color));
responseDocument.Included[0].Relationships.Should().BeNull();
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Id.Should().Be(post.Id);
postCaptured.Caption.Should().Be(post.Caption);
@@ -532,7 +532,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Included[1].Attributes.ShouldContainKey("caption").With(value => value.Should().Be(blog.Owner.Posts[0].Caption));
responseDocument.Included[1].Relationships.Should().BeNull();
- var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single();
+ var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).Which;
blogCaptured.Id.Should().Be(blog.Id);
blogCaptured.Title.Should().Be(blog.Title);
blogCaptured.PlatformName.Should().BeNull();
@@ -620,7 +620,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single();
+ var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).Which;
blogCaptured.Id.Should().Be(blog.Id);
blogCaptured.Title.Should().Be(blog.Title);
blogCaptured.PlatformName.Should().BeNull();
@@ -656,7 +656,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("caption").With(value => value.Should().Be(post.Caption));
responseDocument.Data.ManyValue[0].Relationships.Should().BeNull();
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Id.Should().Be(post.Id);
postCaptured.Caption.Should().Be(post.Caption);
postCaptured.Url.Should().BeNull();
@@ -691,7 +691,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Data.ManyValue[0].Attributes.Should().BeNull();
responseDocument.Data.ManyValue[0].Relationships.Should().BeNull();
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Id.Should().Be(post.Id);
postCaptured.Url.Should().BeNull();
}
@@ -824,7 +824,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("showAdvertisements").With(value => value.Should().Be(blog.ShowAdvertisements));
responseDocument.Data.SingleValue.Relationships.Should().BeNull();
- var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single();
+ var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).Which;
blogCaptured.ShowAdvertisements.Should().Be(blog.ShowAdvertisements);
blogCaptured.IsPublished.Should().Be(blog.IsPublished);
blogCaptured.Title.Should().Be(blog.Title);
@@ -869,7 +869,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
value.Links.Related.ShouldNotBeNull();
});
- var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
+ var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
postCaptured.Id.Should().Be(post.Id);
postCaptured.Caption.Should().Be(post.Caption);
postCaptured.Url.Should().Be(post.Url);
From 923fbd8a813ac9eb50b4198d1310ab68117a5055 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sun, 1 Oct 2023 22:45:39 +0200
Subject: [PATCH 13/53] More specific test assertion
---
.../UnitTests/FieldChains/FieldChainPatternParseTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/JsonApiDotNetCoreTests/UnitTests/FieldChains/FieldChainPatternParseTests.cs b/test/JsonApiDotNetCoreTests/UnitTests/FieldChains/FieldChainPatternParseTests.cs
index bdb5c6c681..d7e5c22cc1 100644
--- a/test/JsonApiDotNetCoreTests/UnitTests/FieldChains/FieldChainPatternParseTests.cs
+++ b/test/JsonApiDotNetCoreTests/UnitTests/FieldChains/FieldChainPatternParseTests.cs
@@ -49,7 +49,7 @@ public void ParseFails(string patternText, string errorMessage)
Action action = () => FieldChainPattern.Parse(patternSource.Text);
// Assert
- PatternFormatException exception = action.Should().Throw().Which;
+ PatternFormatException exception = action.Should().ThrowExactly().Which;
exception.Message.Should().Be(errorMessage);
exception.Position.Should().Be(patternSource.Position);
exception.Pattern.Should().Be(patternSource.Text);
From 2be3358670c712e3861fe36848a89fe3bb1bd617 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 2 Oct 2023 21:55:29 +0000
Subject: [PATCH 14/53] Bump docfx from 2.70.4 to 2.71.0 (#1350)
---
.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 369dfb58c2..3bf1e3fa90 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -21,7 +21,7 @@
]
},
"docfx": {
- "version": "2.70.4",
+ "version": "2.71.0",
"commands": [
"docfx"
]
From da8562ae998989fe26d66d1843b4cd85bbbf6bc8 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Wed, 4 Oct 2023 11:30:22 +0200
Subject: [PATCH 15/53] Add switch for starting pgAdmin in run-docker-postgres
---
run-docker-postgres.ps1 | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/run-docker-postgres.ps1 b/run-docker-postgres.ps1
index 153b93a846..0cd42b3893 100644
--- a/run-docker-postgres.ps1
+++ b/run-docker-postgres.ps1
@@ -1,12 +1,18 @@
#Requires -Version 7.0
-# This script starts a docker container with postgres database, used for running tests.
+# This script starts a PostgreSQL database in a docker container, which is required for running tests locally.
+# When the -UI switch is passed, pgAdmin (a web-based PostgreSQL management tool) is started in a second container, which lets you query the database.
+# To connect to pgAdmin, open http://localhost:5050 and login with user "admin@admin.com", password "postgres". Use hostname "db" when registering the server.
-docker container stop jsonapi-dotnet-core-testing
+param(
+ [switch] $UI=$False
+)
-docker run --rm --name jsonapi-dotnet-core-testing `
- -e POSTGRES_DB=JsonApiDotNetCoreExample `
- -e POSTGRES_USER=postgres `
- -e POSTGRES_PASSWORD=postgres `
- -p 5432:5432 `
- postgres:15
+docker container stop jsonapi-postgresql-db
+docker container stop jsonapi-postgresql-management
+
+docker run --pull always --rm --detach --name jsonapi-postgresql-db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:latest
+
+if ($UI) {
+ docker run --pull always --rm --detach --name jsonapi-postgresql-management --link jsonapi-postgresql-db:db -e PGADMIN_DEFAULT_EMAIL=admin@admin.com -e PGADMIN_DEFAULT_PASSWORD=postgres -p 5050:80 dpage/pgadmin4:latest
+}
From 8082765c68519c73763af8cb41b80ae4e66f9ebf Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Wed, 4 Oct 2023 13:15:49 +0200
Subject: [PATCH 16/53] Remove redundant suppressions after update to
CSharpGuidelinesAnalyzer v3.8.4 (#1351)
---
.../ControllerSourceGenerator.cs | 2 --
.../UnitTests/Links/LinkInclusionTests.cs | 2 --
2 files changed, 4 deletions(-)
diff --git a/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs b/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs
index 89a511b08e..1b47821d22 100644
--- a/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs
+++ b/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs
@@ -6,8 +6,6 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
-#pragma warning disable RS2008 // Enable analyzer release tracking
-
namespace JsonApiDotNetCore.SourceGenerators;
// To debug in Visual Studio (requires v17.2 or higher):
// - Set JsonApiDotNetCore.SourceGenerators as startup project
diff --git a/test/JsonApiDotNetCoreTests/UnitTests/Links/LinkInclusionTests.cs b/test/JsonApiDotNetCoreTests/UnitTests/Links/LinkInclusionTests.cs
index 52dc5cb19c..03cb0e2a4c 100644
--- a/test/JsonApiDotNetCoreTests/UnitTests/Links/LinkInclusionTests.cs
+++ b/test/JsonApiDotNetCoreTests/UnitTests/Links/LinkInclusionTests.cs
@@ -403,7 +403,6 @@ public ResourceType GetResourceTypeForController(Type? controllerType)
private sealed class FakeLinkGenerator : LinkGenerator
{
-#pragma warning disable AV1553 // Do not use optional parameters with default value null for strings, collections or tasks
public override string GetPathByAddress(HttpContext httpContext, TAddress address, RouteValueDictionary values,
RouteValueDictionary? ambientValues = null, PathString? pathBase = null, FragmentString fragment = new(), LinkOptions? options = null)
{
@@ -428,6 +427,5 @@ public override string GetUriByAddress(TAddress address, RouteValueDic
{
throw new NotImplementedException();
}
-#pragma warning restore AV1553 // Do not use optional parameters with default value null for strings, collections or tasks
}
}
From 164c87ef9f1db0e54788e22e60ae35709b8d5ceb Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Fri, 6 Oct 2023 00:00:55 +0200
Subject: [PATCH 17/53] AddJsonApi: Only register IoC services when not already
provided This makes app setup easier. Previously, you often had to register
overrides *after* calling AddJsonApi (last one wins). With this change, order
does not matter anymore. Note that the order of MVC filters still matters, it
is unrelated to this change.
---
docs/usage/common-pitfalls.md | 8 +-
src/Examples/MultiDbContextExample/Program.cs | 6 +-
.../NoEntityFrameworkExample/Program.cs | 4 +-
.../JsonApiApplicationBuilder.cs | 132 +++++++++---------
.../Configuration/ServiceDiscoveryFacade.cs | 5 +-
.../Archiving/ArchiveTests.cs | 2 +-
.../Creating/AtomicCreateResourceTests.cs | 2 +-
...reateResourceWithClientGeneratedIdTests.cs | 2 +-
.../Links/AtomicAbsoluteLinksTests.cs | 2 +-
.../AtomicRelativeLinksWithNamespaceTests.cs | 2 +-
.../Meta/AtomicResourceMetaTests.cs | 2 +-
.../Meta/AtomicResponseMetaTests.cs | 2 +-
.../Mixed/AtomicLoggingTests.cs | 6 +-
.../Mixed/AtomicSerializationTests.cs | 2 +-
.../AtomicModelStateValidationTests.cs | 2 +-
.../QueryStrings/AtomicQueryStringTests.cs | 5 +-
...micSerializationResourceDefinitionTests.cs | 2 +-
...icSparseFieldSetResourceDefinitionTests.cs | 2 +-
.../AtomicTransactionConsistencyTests.cs | 2 +-
.../Resources/AtomicUpdateResourceTests.cs | 2 +-
.../IntegrationTests/Blobs/BlobTests.cs | 2 +-
.../CompositeKeys/CompositeKeyTests.cs | 2 +-
.../ApiControllerAttributeLogTests.cs | 2 +-
.../EagerLoading/EagerLoadingTests.cs | 2 +-
.../ExceptionHandlerTests.cs | 9 +-
.../ModelState/ModelStateValidationTests.cs | 2 +-
.../RequestBody/WorkflowTests.cs | 2 +-
.../Links/AbsoluteLinksWithNamespaceTests.cs | 2 +-
.../AbsoluteLinksWithoutNamespaceTests.cs | 2 +-
.../Links/RelativeLinksWithNamespaceTests.cs | 2 +-
.../RelativeLinksWithoutNamespaceTests.cs | 2 +-
.../IntegrationTests/Logging/LoggingTests.cs | 2 +-
.../Meta/ResourceMetaTests.cs | 3 +-
.../Meta/ResponseMetaTests.cs | 2 +-
.../Meta/TopLevelCountTests.cs | 2 +-
.../FireAndForgetDelivery/FireForgetTests.cs | 2 +-
.../TransactionalOutboxPattern/OutboxTests.cs | 2 +-
.../MultiTenancy/MultiTenancyTests.cs | 11 +-
.../IsUpperCase/IsUpperCaseFilterTests.cs | 2 +-
.../StringLength/LengthFilterTests.cs | 2 +-
.../StringLength/LengthSortTests.cs | 2 +-
.../CustomFunctions/Sum/SumFilterTests.cs | 2 +-
.../TimeOffset/TimeOffsetTests.cs | 2 +-
.../SparseFieldSets/SparseFieldSetTests.cs | 6 +-
...reateResourceWithClientGeneratedIdTests.cs | 2 +-
.../RemoveFromToManyRelationshipTests.cs | 2 +-
.../ReplaceToManyRelationshipTests.cs | 2 +-
.../Updating/Resources/UpdateResourceTests.cs | 2 +-
.../Resources/UpdateToOneRelationshipTests.cs | 2 +-
.../ResourceInjectionTests.cs | 2 +-
.../Reading/ResourceDefinitionReadTests.cs | 2 +-
.../ResourceDefinitionSerializationTests.cs | 3 +-
.../ResourceInheritanceReadTests.cs | 2 +-
.../ResourceInheritanceWriteTests.cs | 2 +-
.../DisableQueryStringTests.cs | 4 +-
.../Serialization/SerializationTests.cs | 2 +-
.../SoftDeletion/SoftDeletionTests.cs | 8 +-
.../DependencyContainerRegistrationTests.cs | 80 +++++++++++
.../IntegrationTestContext.cs | 37 ++---
59 files changed, 234 insertions(+), 179 deletions(-)
diff --git a/docs/usage/common-pitfalls.md b/docs/usage/common-pitfalls.md
index 7941face82..f1f3fed3d6 100644
--- a/docs/usage/common-pitfalls.md
+++ b/docs/usage/common-pitfalls.md
@@ -87,11 +87,13 @@ Neither sounds very compelling. If stored procedures is what you need, you're be
Although recommended by Microsoft for hard-written controllers, the opinionated behavior of [`[ApiController]`](https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-7.0#apicontroller-attribute) violates the JSON:API specification.
Despite JsonApiDotNetCore trying its best to deal with it, the experience won't be as good as leaving it out.
-#### Replace injectable services *after* calling `AddJsonApi()`
-Registering your own services in the IoC container afterwards increases the chances that your replacements will take effect.
-Also, register with `services.AddResourceDefinition/AddResourceService/AddResourceRepository()` instead of `services.AddScoped()`.
+#### Register/override injectable services
+Register your JSON:API resource services, resource definitions and repositories with `services.AddResourceService/AddResourceDefinition/AddResourceRepository()` instead of `services.AddScoped()`.
When using [Auto-discovery](~/usage/resource-graph.md#auto-discovery), you don't need to register these at all.
+> [!NOTE]
+> In older versions of JsonApiDotNetCore, registering your own services in the IoC container *afterwards* increased the chances that your replacements would take effect.
+
#### Never use the Entity Framework Core In-Memory Database Provider
When using this provider, many invalid mappings go unnoticed, leading to strange errors or wrong behavior. A real SQL engine fails to create the schema when mappings are invalid.
If you're in need of a quick setup, use [SQLite](https://www.sqlite.org/). After adding its [NuGet package](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Sqlite), it's as simple as:
diff --git a/src/Examples/MultiDbContextExample/Program.cs b/src/Examples/MultiDbContextExample/Program.cs
index a8acd7ae83..2cf567b9b5 100644
--- a/src/Examples/MultiDbContextExample/Program.cs
+++ b/src/Examples/MultiDbContextExample/Program.cs
@@ -22,6 +22,9 @@
SetDbContextDebugOptions(options);
});
+builder.Services.AddResourceRepository>();
+builder.Services.AddResourceRepository>();
+
builder.Services.AddJsonApi(options =>
{
options.Namespace = "api";
@@ -39,9 +42,6 @@
typeof(DbContextB)
});
-builder.Services.AddResourceRepository>();
-builder.Services.AddResourceRepository>();
-
WebApplication app = builder.Build();
// Configure the HTTP request pipeline.
diff --git a/src/Examples/NoEntityFrameworkExample/Program.cs b/src/Examples/NoEntityFrameworkExample/Program.cs
index 8b299e2c24..8546e939e8 100755
--- a/src/Examples/NoEntityFrameworkExample/Program.cs
+++ b/src/Examples/NoEntityFrameworkExample/Program.cs
@@ -5,6 +5,8 @@
// Add services to the container.
+builder.Services.AddScoped();
+
builder.Services.AddJsonApi(options =>
{
options.Namespace = "api";
@@ -18,8 +20,6 @@
#endif
}, discovery => discovery.AddCurrentAssembly());
-builder.Services.AddScoped();
-
WebApplication app = builder.Build();
// Configure the HTTP request pipeline.
diff --git a/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs b/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs
index c0b4638e40..17ca6677c3 100644
--- a/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs
+++ b/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs
@@ -89,7 +89,7 @@ public void ConfigureResourceGraph(ICollection dbContextTypes, Action
@@ -109,7 +109,7 @@ public void ConfigureMvc()
if (_options.ValidateModelState)
{
_mvcBuilder.AddDataAnnotations();
- _services.AddSingleton();
+ _services.Replace(new ServiceDescriptor(typeof(IModelMetadataProvider), typeof(JsonApiModelMetadataProvider), ServiceLifetime.Singleton));
}
}
@@ -130,19 +130,19 @@ public void ConfigureServiceContainer(ICollection dbContextTypes)
if (dbContextTypes.Any())
{
- _services.AddScoped(typeof(DbContextResolver<>));
+ _services.TryAddScoped(typeof(DbContextResolver<>));
foreach (Type dbContextType in dbContextTypes)
{
Type dbContextResolverClosedType = typeof(DbContextResolver<>).MakeGenericType(dbContextType);
- _services.AddScoped(typeof(IDbContextResolver), dbContextResolverClosedType);
+ _services.TryAddScoped(typeof(IDbContextResolver), dbContextResolverClosedType);
}
- _services.AddScoped();
+ _services.TryAddScoped();
}
else
{
- _services.AddScoped();
+ _services.TryAddScoped();
}
AddResourceLayer();
@@ -153,46 +153,46 @@ public void ConfigureServiceContainer(ICollection dbContextTypes)
AddQueryStringLayer();
AddOperationsLayer();
- _services.AddScoped(typeof(IResourceChangeTracker<>), typeof(ResourceChangeTracker<>));
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
+ _services.TryAddScoped(typeof(IResourceChangeTracker<>), typeof(ResourceChangeTracker<>));
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
}
private void AddMiddlewareLayer()
{
- _services.AddSingleton(_options);
- _services.AddSingleton(this);
- _services.AddSingleton();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddSingleton();
- _services.AddSingleton();
- _services.AddSingleton();
- _services.AddSingleton(sp => sp.GetRequiredService());
- _services.AddSingleton();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
+ _services.TryAddSingleton(_options);
+ _services.TryAddSingleton(this);
+ _services.TryAddSingleton();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddSingleton();
+ _services.TryAddSingleton();
+ _services.TryAddSingleton();
+ _services.TryAddSingleton(provider => provider.GetRequiredService());
+ _services.TryAddSingleton();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
}
private void AddResourceLayer()
{
RegisterImplementationForInterfaces(ServiceDiscoveryFacade.ResourceDefinitionUnboundInterfaces, typeof(JsonApiResourceDefinition<,>));
- _services.AddScoped();
- _services.AddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
}
private void AddRepositoryLayer()
{
RegisterImplementationForInterfaces(ServiceDiscoveryFacade.RepositoryUnboundInterfaces, typeof(EntityFrameworkCoreRepository<,>));
- _services.AddScoped();
+ _services.TryAddScoped();
_services.TryAddTransient();
_services.TryAddTransient();
@@ -225,12 +225,12 @@ private void AddQueryStringLayer()
_services.TryAddTransient();
_services.TryAddTransient();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
RegisterDependentService();
RegisterDependentService();
@@ -246,50 +246,50 @@ private void AddQueryStringLayer()
RegisterDependentService();
RegisterDependentService();
- _services.AddScoped();
- _services.AddSingleton();
+ _services.TryAddScoped();
+ _services.TryAddSingleton();
}
private void RegisterDependentService()
where TCollectionElement : class
where TElementToAdd : TCollectionElement
{
- _services.AddScoped(serviceProvider => serviceProvider.GetRequiredService());
+ _services.AddScoped(provider => provider.GetRequiredService());
}
private void AddSerializationLayer()
{
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
-
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
- _services.AddSingleton();
- _services.AddSingleton();
- _services.AddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddSingleton();
+ _services.TryAddSingleton();
+ _services.TryAddScoped();
}
private void AddOperationsLayer()
{
- _services.AddScoped(typeof(ICreateProcessor<,>), typeof(CreateProcessor<,>));
- _services.AddScoped(typeof(IUpdateProcessor<,>), typeof(UpdateProcessor<,>));
- _services.AddScoped(typeof(IDeleteProcessor<,>), typeof(DeleteProcessor<,>));
- _services.AddScoped(typeof(IAddToRelationshipProcessor<,>), typeof(AddToRelationshipProcessor<,>));
- _services.AddScoped(typeof(ISetRelationshipProcessor<,>), typeof(SetRelationshipProcessor<,>));
- _services.AddScoped(typeof(IRemoveFromRelationshipProcessor<,>), typeof(RemoveFromRelationshipProcessor<,>));
-
- _services.AddScoped();
- _services.AddScoped();
- _services.AddScoped();
+ _services.TryAddScoped(typeof(ICreateProcessor<,>), typeof(CreateProcessor<,>));
+ _services.TryAddScoped(typeof(IUpdateProcessor<,>), typeof(UpdateProcessor<,>));
+ _services.TryAddScoped(typeof(IDeleteProcessor<,>), typeof(DeleteProcessor<,>));
+ _services.TryAddScoped(typeof(IAddToRelationshipProcessor<,>), typeof(AddToRelationshipProcessor<,>));
+ _services.TryAddScoped(typeof(ISetRelationshipProcessor<,>), typeof(SetRelationshipProcessor<,>));
+ _services.TryAddScoped(typeof(IRemoveFromRelationshipProcessor<,>), typeof(RemoveFromRelationshipProcessor<,>));
+
+ _services.TryAddScoped();
+ _services.TryAddScoped();
+ _services.TryAddScoped();
}
public void Dispose()
diff --git a/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs b/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs
index 85f95c232f..d17ddfa1ba 100644
--- a/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs
+++ b/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs
@@ -5,6 +5,7 @@
using JsonApiDotNetCore.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
namespace JsonApiDotNetCore.Configuration;
@@ -119,7 +120,7 @@ private void AddDbContextResolvers(Assembly assembly)
foreach (Type dbContextType in dbContextTypes)
{
Type dbContextResolverClosedType = typeof(DbContextResolver<>).MakeGenericType(dbContextType);
- _services.AddScoped(typeof(IDbContextResolver), dbContextResolverClosedType);
+ _services.TryAddScoped(typeof(IDbContextResolver), dbContextResolverClosedType);
}
}
@@ -163,7 +164,7 @@ private void RegisterImplementations(Assembly assembly, Type interfaceType, Reso
if (result != null)
{
(Type implementationType, Type serviceInterface) = result.Value;
- _services.AddScoped(serviceInterface, implementationType);
+ _services.TryAddScoped(serviceInterface, implementationType);
}
}
}
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Archiving/ArchiveTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Archiving/ArchiveTests.cs
index 2af39b3d26..7c282051f0 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Archiving/ArchiveTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Archiving/ArchiveTests.cs
@@ -21,7 +21,7 @@ public ArchiveTests(IntegrationTestContext,
testContext.UseController();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs
index 3331b1f1cc..99b3b3bc5b 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs
@@ -27,7 +27,7 @@ public AtomicCreateResourceTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesBeforeStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddSingleton();
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs
index 15dbc19b07..5bd4acb39e 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs
@@ -24,7 +24,7 @@ public AtomicCreateResourceWithClientGeneratedIdTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs
index a6e162f72a..fdc7369a71 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs
@@ -25,7 +25,7 @@ public AtomicAbsoluteLinksTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs
index db6ee06bbf..9184161c07 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs
@@ -26,7 +26,7 @@ public AtomicRelativeLinksWithNamespaceTests(
testContext.UseController();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs
index 2bd9dc8edf..3edb88b14a 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs
@@ -22,7 +22,7 @@ public AtomicResourceMetaTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs
index ab084a0e90..e4c31db1e6 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs
@@ -21,7 +21,7 @@ public AtomicResponseMetaTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicLoggingTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicLoggingTests.cs
index f871e90238..d59cd3d8b2 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicLoggingTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicLoggingTests.cs
@@ -28,13 +28,9 @@ public AtomicLoggingTests(IntegrationTestContext
+ testContext.ConfigureServices(services =>
{
services.AddSingleton(loggerFactory);
- });
-
- testContext.ConfigureServicesAfterStartup(services =>
- {
services.AddSingleton();
});
}
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicSerializationTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicSerializationTests.cs
index 0dcc99fdcd..b59100dbd9 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicSerializationTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicSerializationTests.cs
@@ -21,7 +21,7 @@ public AtomicSerializationTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs
index 03a04fb431..4a8b7d9e52 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs
@@ -18,7 +18,7 @@ public AtomicModelStateValidationTests(IntegrationTestContext
+ _testContext.ConfigureServices(services =>
{
services.AddSingleton();
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs
index 392a76c08d..a9d0fbd44b 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs
@@ -21,10 +21,11 @@ public AtomicQueryStringTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
- services.AddSingleton();
services.AddResourceDefinition();
+
+ services.AddSingleton();
});
}
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/Serialization/AtomicSerializationResourceDefinitionTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/Serialization/AtomicSerializationResourceDefinitionTests.cs
index 27e44ec234..4e2fa4f937 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/Serialization/AtomicSerializationResourceDefinitionTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/Serialization/AtomicSerializationResourceDefinitionTests.cs
@@ -22,7 +22,7 @@ public AtomicSerializationResourceDefinitionTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/SparseFieldSets/AtomicSparseFieldSetResourceDefinitionTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/SparseFieldSets/AtomicSparseFieldSetResourceDefinitionTests.cs
index f70a289ba1..63fb7e8eb2 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/SparseFieldSets/AtomicSparseFieldSetResourceDefinitionTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/SparseFieldSets/AtomicSparseFieldSetResourceDefinitionTests.cs
@@ -21,7 +21,7 @@ public AtomicSparseFieldSetResourceDefinitionTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs
index d5e74fa4c3..896813986d 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs
@@ -21,7 +21,7 @@ public AtomicTransactionConsistencyTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceRepository();
services.AddResourceRepository();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs
index 895d1a0df5..0af67d4c20 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs
@@ -25,7 +25,7 @@ public AtomicUpdateResourceTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/BlobTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/BlobTests.cs
index 4d21e284e8..727245f06e 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/BlobTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/BlobTests.cs
@@ -19,7 +19,7 @@ public BlobTests(IntegrationTestContext, BlobDbCo
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs
index 3ff947d7b4..a015ac52fa 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs
@@ -21,7 +21,7 @@ public CompositeKeyTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceRepository>();
services.AddResourceRepository>();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/ApiControllerAttributeLogTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/ApiControllerAttributeLogTests.cs
index 2b4a8c70d6..dce62dec7e 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/ApiControllerAttributeLogTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/CustomRoutes/ApiControllerAttributeLogTests.cs
@@ -22,7 +22,7 @@ public ApiControllerAttributeLogTests()
options.AddProvider(_loggerFactory);
});
- ConfigureServicesBeforeStartup(services =>
+ ConfigureServices(services =>
{
services.AddSingleton(_loggerFactory);
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs
index 5d2ddf0ece..f12123c203 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs
@@ -21,7 +21,7 @@ public EagerLoadingTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
services.AddResourceRepository();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs
index 53a2415627..7bf804a7d0 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs
@@ -30,14 +30,11 @@ public ExceptionHandlerTests(IntegrationTestContext
- {
- services.AddSingleton(loggerFactory);
- });
-
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceService();
+
+ services.AddSingleton(loggerFactory);
services.AddScoped();
});
}
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs
index 9e104eef01..55e293aab1 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState/ModelStateValidationTests.cs
@@ -19,7 +19,7 @@ public ModelStateValidationTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesBeforeStartup(services =>
+ testContext.ConfigureServices(services =>
{
// Polyfill for missing DateOnly/TimeOnly support in .NET 6 ModelState validation.
services.AddDateOnlyTimeOnlyStringConverters();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/RequestBody/WorkflowTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/RequestBody/WorkflowTests.cs
index 4653118ab6..895a8d2dc8 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/RequestBody/WorkflowTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/RequestBody/WorkflowTests.cs
@@ -17,7 +17,7 @@ public WorkflowTests(IntegrationTestContext,
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs
index 62ba148dc4..e2449d802b 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs
@@ -25,7 +25,7 @@ public AbsoluteLinksWithNamespaceTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs
index 0d496f18eb..48f49abb99 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs
@@ -25,7 +25,7 @@ public AbsoluteLinksWithoutNamespaceTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs
index a51f522b82..fb26ca6533 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs
@@ -25,7 +25,7 @@ public RelativeLinksWithNamespaceTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs
index cf614fc8f8..4fc2198bca 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs
@@ -25,7 +25,7 @@ public RelativeLinksWithoutNamespaceTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Logging/LoggingTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Logging/LoggingTests.cs
index d297467bc4..3b92994de9 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Logging/LoggingTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Logging/LoggingTests.cs
@@ -27,7 +27,7 @@ public LoggingTests(IntegrationTestContext, Lo
options.SetMinimumLevel(LogLevel.Trace);
});
- testContext.ConfigureServicesBeforeStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddSingleton(loggerFactory);
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResourceMetaTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResourceMetaTests.cs
index ba15de73d7..230bdd8b23 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResourceMetaTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResourceMetaTests.cs
@@ -20,9 +20,10 @@ public ResourceMetaTests(IntegrationTestContext,
testContext.UseController();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
+
services.AddSingleton();
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResponseMetaTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResponseMetaTests.cs
index 5b86a62322..a5ae347886 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResponseMetaTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/ResponseMetaTests.cs
@@ -19,7 +19,7 @@ public ResponseMetaTests(IntegrationTestContext,
testContext.UseController();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddSingleton();
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs
index 8bfb268daa..955a8514b6 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs
@@ -21,7 +21,7 @@ public TopLevelCountTests(IntegrationTestContext,
testContext.UseController();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
});
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/FireAndForgetDelivery/FireForgetTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/FireAndForgetDelivery/FireForgetTests.cs
index fe7eabd112..86456d2d43 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/FireAndForgetDelivery/FireForgetTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/FireAndForgetDelivery/FireForgetTests.cs
@@ -20,7 +20,7 @@ public FireForgetTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/TransactionalOutboxPattern/OutboxTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/TransactionalOutboxPattern/OutboxTests.cs
index 529fcdab6c..2faa69051a 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/TransactionalOutboxPattern/OutboxTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Microservices/TransactionalOutboxPattern/OutboxTests.cs
@@ -23,7 +23,7 @@ public OutboxTests(IntegrationTestContext, Outb
testContext.UseController();
testContext.UseController();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceDefinition();
services.AddResourceDefinition();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/MultiTenancy/MultiTenancyTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/MultiTenancy/MultiTenancyTests.cs
index b2b100b0bd..e48470c6ab 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/MultiTenancy/MultiTenancyTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/MultiTenancy/MultiTenancyTests.cs
@@ -25,16 +25,13 @@ public MultiTenancyTests(IntegrationTestContext();
testContext.UseController();
- testContext.ConfigureServicesBeforeStartup(services =>
- {
- services.AddSingleton();
- services.AddScoped();
- });
-
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddResourceService>();
services.AddResourceService>();
+
+ services.AddSingleton();
+ services.AddScoped();
});
var options = (JsonApiOptions)_testContext.Factory.Services.GetRequiredService();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/CustomFunctions/IsUpperCase/IsUpperCaseFilterTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/CustomFunctions/IsUpperCase/IsUpperCaseFilterTests.cs
index a61c8ea744..be3240fdef 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/CustomFunctions/IsUpperCase/IsUpperCaseFilterTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/QueryStrings/CustomFunctions/IsUpperCase/IsUpperCaseFilterTests.cs
@@ -20,7 +20,7 @@ public IsUpperCaseFilterTests(IntegrationTestContext();
- testContext.ConfigureServicesAfterStartup(services =>
+ testContext.ConfigureServices(services =>
{
services.AddTransient();
services.AddTransient