diff --git a/Directory.Build.props b/Directory.Build.props
index 534f9bb7af..375ee5066f 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -27,6 +27,6 @@
false
$(MSBuildThisFileDirectory)CodingGuidelines.ruleset
$(MSBuildThisFileDirectory)tests.runsettings
- 5.5.2
+ 5.6.1
diff --git a/src/Examples/DapperExample/Repositories/DapperRepository.cs b/src/Examples/DapperExample/Repositories/DapperRepository.cs
index bbbeda2ea3..0c54b34353 100644
--- a/src/Examples/DapperExample/Repositories/DapperRepository.cs
+++ b/src/Examples/DapperExample/Repositories/DapperRepository.cs
@@ -1,4 +1,5 @@
using System.Data.Common;
+using System.Diagnostics.CodeAnalysis;
using Dapper;
using DapperExample.AtomicOperations;
using DapperExample.TranslationToSql;
@@ -177,7 +178,7 @@ public async Task CountAsync(FilterExpression? filter, CancellationToken ca
}
///
- public Task GetForCreateAsync(Type resourceClrType, TId id, CancellationToken cancellationToken)
+ public Task GetForCreateAsync(Type resourceClrType, [DisallowNull] TId id, CancellationToken cancellationToken)
{
ArgumentGuard.NotNull(resourceClrType);
@@ -355,7 +356,7 @@ await ExecuteInTransactionAsync(async transaction =>
}
///
- public async Task DeleteAsync(TResource? resourceFromDatabase, TId id, CancellationToken cancellationToken)
+ public async Task DeleteAsync(TResource? resourceFromDatabase, [DisallowNull] TId id, CancellationToken cancellationToken)
{
TResource placeholderResource = resourceFromDatabase ?? _resourceFactory.CreateInstance();
placeholderResource.Id = id;
@@ -451,7 +452,7 @@ await ExecuteInTransactionAsync(async transaction =>
}
///
- public async Task AddToToManyRelationshipAsync(TResource? leftResource, TId leftId, ISet rightResourceIds,
+ public async Task AddToToManyRelationshipAsync(TResource? leftResource, [DisallowNull] TId leftId, ISet rightResourceIds,
CancellationToken cancellationToken)
{
ArgumentGuard.NotNull(rightResourceIds);
diff --git a/src/Examples/NoEntityFrameworkExample/Services/InMemoryResourceService.cs b/src/Examples/NoEntityFrameworkExample/Services/InMemoryResourceService.cs
index e9b37560fc..ee9d2196e9 100644
--- a/src/Examples/NoEntityFrameworkExample/Services/InMemoryResourceService.cs
+++ b/src/Examples/NoEntityFrameworkExample/Services/InMemoryResourceService.cs
@@ -1,4 +1,5 @@
using System.Collections;
+using System.Diagnostics.CodeAnalysis;
using JsonApiDotNetCore.Configuration;
using JsonApiDotNetCore.Errors;
using JsonApiDotNetCore.Queries;
@@ -114,7 +115,7 @@ private bool SetPrimaryTotalCountIsZero()
}
///
- public Task GetAsync(TId id, CancellationToken cancellationToken)
+ public Task GetAsync([DisallowNull] TId id, CancellationToken cancellationToken)
{
QueryLayer queryLayer = _queryLayerComposer.ComposeForGetById(id, _resourceType, TopFieldSelection.PreserveExisting);
@@ -124,14 +125,14 @@ public Task GetAsync(TId id, CancellationToken cancellationToken)
if (resource == null)
{
- throw new ResourceNotFoundException(id!.ToString()!, _resourceType.PublicName);
+ throw new ResourceNotFoundException(id.ToString()!, _resourceType.PublicName);
}
return Task.FromResult(resource);
}
///
- public Task