From 6b69ed3f8f396348b1665e6395acfb77ab74c4bd Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Fri, 9 Sep 2022 14:36:27 +0200
Subject: [PATCH 01/47] Fixed error in documentation example
---
docs/usage/extensibility/controllers.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/usage/extensibility/controllers.md b/docs/usage/extensibility/controllers.md
index 0c71f45090..7e54d3fb9c 100644
--- a/docs/usage/extensibility/controllers.md
+++ b/docs/usage/extensibility/controllers.md
@@ -39,7 +39,7 @@ DELETE http://localhost:14140/articles/1 HTTP/1.1
```json
{
"links": {
- "self": "/articles"
+ "self": "/articles/1"
},
"errors": [
{
From 79d918a7a442de304205a5195cd707215d472a93 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 1 Oct 2022 12:41:40 +0200
Subject: [PATCH 02/47] Update links to JSON:API v1.1-final
---
README.md | 2 +-
docs/usage/reading/including-relationships.md | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/Document.cs | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/ErrorLinks.cs | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/ErrorObject.cs | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/ErrorSource.cs | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs | 2 +-
.../Serialization/Objects/RelationshipLinks.cs | 2 +-
.../Serialization/Objects/RelationshipObject.cs | 2 +-
.../Serialization/Objects/ResourceIdentifierObject.cs | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/ResourceLinks.cs | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/ResourceObject.cs | 2 +-
src/JsonApiDotNetCore/Serialization/Objects/TopLevelLinks.cs | 2 +-
13 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index e2291f080e..35adb3fe9f 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ These are some steps you can take to help you understand what this project is an
- [Embercasts: Full Stack Ember with ASP.NET Core](https://www.embercasts.com/course/full-stack-ember-with-dotnet/watch/whats-in-this-course-cs) (paid course, 2017)
### Official documentation
-- [The JSON:API specification](https://jsonapi.org/format/1.1/)
+- [The JSON:API specification](https://jsonapi.org/format/)
- [JsonApiDotNetCore website](https://www.jsonapi.net/)
- [Roadmap](ROADMAP.md)
diff --git a/docs/usage/reading/including-relationships.md b/docs/usage/reading/including-relationships.md
index f22d2321aa..0b69a007c1 100644
--- a/docs/usage/reading/including-relationships.md
+++ b/docs/usage/reading/including-relationships.md
@@ -1,6 +1,6 @@
# Including Relationships
-JsonApiDotNetCore supports [request include params](http://jsonapi.org/format/#fetching-includes) out of the box,
+JsonApiDotNetCore supports [request include params](https://jsonapi.org/format/#fetching-includes) out of the box,
for side-loading related resources.
```http
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/Document.cs b/src/JsonApiDotNetCore/Serialization/Objects/Document.cs
index 2f40aeb27b..e0d7d5def3 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/Document.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/Document.cs
@@ -3,7 +3,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See https://jsonapi.org/format/1.1/#document-top-level and https://jsonapi.org/ext/atomic/#document-structure.
+/// See https://jsonapi.org/format#document-top-level and https://jsonapi.org/ext/atomic/#document-structure.
///
public sealed class Document
{
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/ErrorLinks.cs b/src/JsonApiDotNetCore/Serialization/Objects/ErrorLinks.cs
index 4b8d4de528..6ba2c2a6f6 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/ErrorLinks.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/ErrorLinks.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See "links" in https://jsonapi.org/format/1.1/#error-objects.
+/// See "links" in https://jsonapi.org/format/#error-objects.
///
[PublicAPI]
public sealed class ErrorLinks
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/ErrorObject.cs b/src/JsonApiDotNetCore/Serialization/Objects/ErrorObject.cs
index 87ad1ebefe..68a2a19d3a 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/ErrorObject.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/ErrorObject.cs
@@ -5,7 +5,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See https://jsonapi.org/format/1.1/#error-objects.
+/// See https://jsonapi.org/format/#error-objects.
///
[PublicAPI]
public sealed class ErrorObject
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/ErrorSource.cs b/src/JsonApiDotNetCore/Serialization/Objects/ErrorSource.cs
index 156f734aa2..b9242895f4 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/ErrorSource.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/ErrorSource.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See "source" in https://jsonapi.org/format/1.1/#error-objects.
+/// See "source" in https://jsonapi.org/format/#error-objects.
///
[PublicAPI]
public sealed class ErrorSource
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs b/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs
index 4a48f90099..66daec22ff 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/JsonApiObject.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See https://jsonapi.org/format/1.1/#document-jsonapi-object.
+/// See https://jsonapi.org/format/#document-jsonapi-object.
///
[PublicAPI]
public sealed class JsonApiObject
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/RelationshipLinks.cs b/src/JsonApiDotNetCore/Serialization/Objects/RelationshipLinks.cs
index f3f6c2bf02..4c1095e1a7 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/RelationshipLinks.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/RelationshipLinks.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See "links" in https://jsonapi.org/format/1.1/#document-resource-object-relationships.
+/// See "links" in https://jsonapi.org/format/#document-resource-object-relationships.
///
[PublicAPI]
public sealed class RelationshipLinks
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/RelationshipObject.cs b/src/JsonApiDotNetCore/Serialization/Objects/RelationshipObject.cs
index 9411ecf83a..c677e9a0fb 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/RelationshipObject.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/RelationshipObject.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See https://jsonapi.org/format/1.1/#document-resource-object-relationships.
+/// See https://jsonapi.org/format/#document-resource-object-relationships.
///
[PublicAPI]
public sealed class RelationshipObject
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/ResourceIdentifierObject.cs b/src/JsonApiDotNetCore/Serialization/Objects/ResourceIdentifierObject.cs
index 20c30909ed..e82ebe16bf 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/ResourceIdentifierObject.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/ResourceIdentifierObject.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See https://jsonapi.org/format/1.1/#document-resource-identifier-objects.
+/// See https://jsonapi.org/format/#document-resource-identifier-objects.
///
[PublicAPI]
public class ResourceIdentifierObject : ResourceIdentity
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/ResourceLinks.cs b/src/JsonApiDotNetCore/Serialization/Objects/ResourceLinks.cs
index 22c396082d..6f749cca88 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/ResourceLinks.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/ResourceLinks.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See https://jsonapi.org/format/1.1/#document-resource-object-links.
+/// See https://jsonapi.org/format/#document-resource-object-links.
///
[PublicAPI]
public sealed class ResourceLinks
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/ResourceObject.cs b/src/JsonApiDotNetCore/Serialization/Objects/ResourceObject.cs
index ed38a40f9a..fc1ff3d146 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/ResourceObject.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/ResourceObject.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See https://jsonapi.org/format/1.1/#document-resource-objects.
+/// See https://jsonapi.org/format/#document-resource-objects.
///
[PublicAPI]
public sealed class ResourceObject : ResourceIdentifierObject
diff --git a/src/JsonApiDotNetCore/Serialization/Objects/TopLevelLinks.cs b/src/JsonApiDotNetCore/Serialization/Objects/TopLevelLinks.cs
index 14578253c2..f83510fb23 100644
--- a/src/JsonApiDotNetCore/Serialization/Objects/TopLevelLinks.cs
+++ b/src/JsonApiDotNetCore/Serialization/Objects/TopLevelLinks.cs
@@ -4,7 +4,7 @@
namespace JsonApiDotNetCore.Serialization.Objects;
///
-/// See "links" in https://jsonapi.org/format/1.1/#document-top-level.
+/// See "links" in https://jsonapi.org/format/#document-top-level.
///
[PublicAPI]
public sealed class TopLevelLinks
From 1dc249bf5c8f46216a871913f6d9931a91c59525 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Wed, 28 Sep 2022 04:39:53 +0200
Subject: [PATCH 03/47] Improve error message when duplicate controllers are
found, to include the fully qualified type names of the conflicting
controllers
---
src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs | 3 ++-
.../DuplicateResourceControllerTests.cs | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs
index fe95d93446..58f8d18560 100644
--- a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs
+++ b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs
@@ -78,7 +78,8 @@ public void Apply(ApplicationModel application)
{
if (_controllerPerResourceTypeMap.ContainsKey(resourceType))
{
- throw new InvalidConfigurationException($"Multiple controllers found for resource type '{resourceType}'.");
+ throw new InvalidConfigurationException(
+ $"Multiple controllers found for resource type '{resourceType}': '{_controllerPerResourceTypeMap[resourceType].ControllerType}' and '{controller.ControllerType}'.");
}
_resourceTypePerControllerTypeMap.Add(controller.ControllerType, resourceType);
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/NonJsonApiControllers/DuplicateResourceControllerTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/NonJsonApiControllers/DuplicateResourceControllerTests.cs
index b130523588..0f1b1178f4 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/NonJsonApiControllers/DuplicateResourceControllerTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/NonJsonApiControllers/DuplicateResourceControllerTests.cs
@@ -20,6 +20,9 @@ public void Fails_at_startup_when_multiple_controllers_exist_for_same_resource_t
Action action = () => _ = Factory;
// Assert
- action.Should().ThrowExactly().WithMessage("Multiple controllers found for resource type 'knownResources'.");
+ InvalidConfigurationException exception = action.Should().ThrowExactly().Which!;
+ exception.Message.Should().StartWith("Multiple controllers found for resource type 'knownResources': ");
+ exception.Message.Should().Contain($"'{typeof(KnownResourcesController).FullName}'");
+ exception.Message.Should().Contain($"'{typeof(DuplicateKnownResourcesController).FullName}'");
}
}
From 70c06b941d2201c53c8e0940cd4cf0420cfa40df Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Wed, 28 Sep 2022 03:14:21 +0200
Subject: [PATCH 04/47] Multi-target Annotations against .NET Standard 1.0
---
JsonApiDotNetCore.sln | 15 +++++++++++++
...ndpoints.cs => JsonApiEndpoints.shared.cs} | 0
.../JsonApiDotNetCore.Annotations.csproj | 22 +++++++++++++++++--
.../Annotations/AttrAttribute.netstandard.cs | 14 ++++++++++++
...bilities.cs => AttrCapabilities.shared.cs} | 3 +++
.../EagerLoadAttribute.netstandard.cs | 12 ++++++++++
.../HasManyAttribute.netstandard.cs | 12 ++++++++++
.../HasOneAttribute.netstandard.cs | 12 ++++++++++
.../{LinkTypes.cs => LinkTypes.shared.cs} | 0
...ibute.cs => NoResourceAttribute.shared.cs} | 0
.../RelationshipAttribute.netstandard.cs | 16 ++++++++++++++
...tribute.cs => ResourceAttribute.shared.cs} | 0
.../ResourceFieldAttribute.netstandard.cs | 13 +++++++++++
...te.cs => ResourceLinksAttribute.shared.cs} | 0
...dentifiable.cs => IIdentifiable.shared.cs} | 4 ++++
.../Resources/Identifiable.netstandard.cs | 16 ++++++++++++++
test/AnnotationTests/AnnotationTests.csproj | 20 +++++++++++++++++
test/AnnotationTests/Models/HiddenNode.cs | 14 ++++++++++++
test/AnnotationTests/Models/TreeNode.cs | 20 +++++++++++++++++
19 files changed, 191 insertions(+), 2 deletions(-)
rename src/JsonApiDotNetCore.Annotations/Controllers/{JsonApiEndpoints.cs => JsonApiEndpoints.shared.cs} (100%)
create mode 100644 src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrAttribute.netstandard.cs
rename src/JsonApiDotNetCore.Annotations/Resources/Annotations/{AttrCapabilities.cs => AttrCapabilities.shared.cs} (96%)
create mode 100644 src/JsonApiDotNetCore.Annotations/Resources/Annotations/EagerLoadAttribute.netstandard.cs
create mode 100644 src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasManyAttribute.netstandard.cs
create mode 100644 src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasOneAttribute.netstandard.cs
rename src/JsonApiDotNetCore.Annotations/Resources/Annotations/{LinkTypes.cs => LinkTypes.shared.cs} (100%)
rename src/JsonApiDotNetCore.Annotations/Resources/Annotations/{NoResourceAttribute.cs => NoResourceAttribute.shared.cs} (100%)
create mode 100644 src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.netstandard.cs
rename src/JsonApiDotNetCore.Annotations/Resources/Annotations/{ResourceAttribute.cs => ResourceAttribute.shared.cs} (100%)
create mode 100644 src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.netstandard.cs
rename src/JsonApiDotNetCore.Annotations/Resources/Annotations/{ResourceLinksAttribute.cs => ResourceLinksAttribute.shared.cs} (100%)
rename src/JsonApiDotNetCore.Annotations/Resources/{IIdentifiable.cs => IIdentifiable.shared.cs} (94%)
create mode 100644 src/JsonApiDotNetCore.Annotations/Resources/Identifiable.netstandard.cs
create mode 100644 test/AnnotationTests/AnnotationTests.csproj
create mode 100644 test/AnnotationTests/Models/HiddenNode.cs
create mode 100644 test/AnnotationTests/Models/TreeNode.cs
diff --git a/JsonApiDotNetCore.sln b/JsonApiDotNetCore.sln
index 21b1cca7ce..e034595875 100644
--- a/JsonApiDotNetCore.sln
+++ b/JsonApiDotNetCore.sln
@@ -52,6 +52,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.Annotatio
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabasePerTenantExample", "src\Examples\DatabasePerTenantExample\DatabasePerTenantExample.csproj", "{60334658-BE51-43B3-9C4D-F2BBF56C89CE}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnnotationTests", "test\AnnotationTests\AnnotationTests.csproj", "{24B0C12F-38CD-4245-8785-87BEFAD55B00}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -266,6 +268,18 @@ Global
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|x64.Build.0 = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|x86.ActiveCfg = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|x86.Build.0 = Release|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Debug|x64.Build.0 = Debug|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Debug|x86.Build.0 = Debug|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Release|Any CPU.Build.0 = Release|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Release|x64.ActiveCfg = Release|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Release|x64.Build.0 = Release|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Release|x86.ActiveCfg = Release|Any CPU
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -288,6 +302,7 @@ Global
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{83FF097C-C8C6-477B-9FAB-DF99B84978B5} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
{60334658-BE51-43B3-9C4D-F2BBF56C89CE} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
+ {24B0C12F-38CD-4245-8785-87BEFAD55B00} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A2421882-8F0A-4905-928F-B550B192F9A4}
diff --git a/src/JsonApiDotNetCore.Annotations/Controllers/JsonApiEndpoints.cs b/src/JsonApiDotNetCore.Annotations/Controllers/JsonApiEndpoints.shared.cs
similarity index 100%
rename from src/JsonApiDotNetCore.Annotations/Controllers/JsonApiEndpoints.cs
rename to src/JsonApiDotNetCore.Annotations/Controllers/JsonApiEndpoints.shared.cs
diff --git a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
index 7c78f620ed..5f4d7c1d76 100644
--- a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
+++ b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
@@ -1,9 +1,10 @@
-
+
- $(TargetFrameworkName)
+ $(TargetFrameworkName);netstandard1.0
true
true
JsonApiDotNetCore
+ latest
@@ -27,4 +28,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrAttribute.netstandard.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrAttribute.netstandard.cs
new file mode 100644
index 0000000000..a7915240dc
--- /dev/null
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrAttribute.netstandard.cs
@@ -0,0 +1,14 @@
+using JetBrains.Annotations;
+
+namespace JsonApiDotNetCore.Resources.Annotations;
+
+///
+/// A simplified version, provided for convenience to multi-target against NetStandard. Does not actually work with JsonApiDotNetCore.
+///
+[PublicAPI]
+[AttributeUsage(AttributeTargets.Property)]
+public sealed class AttrAttribute : ResourceFieldAttribute
+{
+ ///
+ public AttrCapabilities Capabilities { get; set; }
+}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrCapabilities.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrCapabilities.shared.cs
similarity index 96%
rename from src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrCapabilities.cs
rename to src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrCapabilities.shared.cs
index c6f849fdff..2812be6d39 100644
--- a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrCapabilities.cs
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/AttrCapabilities.shared.cs
@@ -1,8 +1,11 @@
+using JetBrains.Annotations;
+
namespace JsonApiDotNetCore.Resources.Annotations;
///
/// Indicates capabilities that can be performed on an .
///
+[PublicAPI]
[Flags]
public enum AttrCapabilities
{
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/EagerLoadAttribute.netstandard.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/EagerLoadAttribute.netstandard.cs
new file mode 100644
index 0000000000..47052a078c
--- /dev/null
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/EagerLoadAttribute.netstandard.cs
@@ -0,0 +1,12 @@
+using JetBrains.Annotations;
+
+namespace JsonApiDotNetCore.Resources.Annotations;
+
+///
+/// A simplified version, provided for convenience to multi-target against NetStandard. Does not actually work with JsonApiDotNetCore.
+///
+[PublicAPI]
+[AttributeUsage(AttributeTargets.Property)]
+public sealed class EagerLoadAttribute : Attribute
+{
+}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasManyAttribute.netstandard.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasManyAttribute.netstandard.cs
new file mode 100644
index 0000000000..1cdeb9f62f
--- /dev/null
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasManyAttribute.netstandard.cs
@@ -0,0 +1,12 @@
+using JetBrains.Annotations;
+
+namespace JsonApiDotNetCore.Resources.Annotations;
+
+///
+/// A simplified version, provided for convenience to multi-target against NetStandard. Does not actually work with JsonApiDotNetCore.
+///
+[PublicAPI]
+[AttributeUsage(AttributeTargets.Property)]
+public sealed class HasManyAttribute : RelationshipAttribute
+{
+}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasOneAttribute.netstandard.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasOneAttribute.netstandard.cs
new file mode 100644
index 0000000000..1c16fb01b2
--- /dev/null
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/HasOneAttribute.netstandard.cs
@@ -0,0 +1,12 @@
+using JetBrains.Annotations;
+
+namespace JsonApiDotNetCore.Resources.Annotations;
+
+///
+/// A simplified version, provided for convenience to multi-target against NetStandard. Does not actually work with JsonApiDotNetCore.
+///
+[PublicAPI]
+[AttributeUsage(AttributeTargets.Property)]
+public sealed class HasOneAttribute : RelationshipAttribute
+{
+}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/LinkTypes.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/LinkTypes.shared.cs
similarity index 100%
rename from src/JsonApiDotNetCore.Annotations/Resources/Annotations/LinkTypes.cs
rename to src/JsonApiDotNetCore.Annotations/Resources/Annotations/LinkTypes.shared.cs
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/NoResourceAttribute.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/NoResourceAttribute.shared.cs
similarity index 100%
rename from src/JsonApiDotNetCore.Annotations/Resources/Annotations/NoResourceAttribute.cs
rename to src/JsonApiDotNetCore.Annotations/Resources/Annotations/NoResourceAttribute.shared.cs
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.netstandard.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.netstandard.cs
new file mode 100644
index 0000000000..51517b3d51
--- /dev/null
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.netstandard.cs
@@ -0,0 +1,16 @@
+using JetBrains.Annotations;
+
+namespace JsonApiDotNetCore.Resources.Annotations;
+
+///
+/// A simplified version, provided for convenience to multi-target against NetStandard. Does not actually work with JsonApiDotNetCore.
+///
+[PublicAPI]
+public abstract class RelationshipAttribute : ResourceFieldAttribute
+{
+ ///
+ public LinkTypes Links { get; set; } = LinkTypes.NotConfigured;
+
+ ///
+ public bool CanInclude { get; set; } = true;
+}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.shared.cs
similarity index 100%
rename from src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.cs
rename to src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.shared.cs
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.netstandard.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.netstandard.cs
new file mode 100644
index 0000000000..958794365d
--- /dev/null
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.netstandard.cs
@@ -0,0 +1,13 @@
+using JetBrains.Annotations;
+
+namespace JsonApiDotNetCore.Resources.Annotations;
+
+///
+/// A simplified version, provided for convenience to multi-target against NetStandard. Does not actually work with JsonApiDotNetCore.
+///
+[PublicAPI]
+public abstract class ResourceFieldAttribute : Attribute
+{
+ ///
+ public string PublicName { get; set; } = null!;
+}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceLinksAttribute.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceLinksAttribute.shared.cs
similarity index 100%
rename from src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceLinksAttribute.cs
rename to src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceLinksAttribute.shared.cs
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/IIdentifiable.cs b/src/JsonApiDotNetCore.Annotations/Resources/IIdentifiable.shared.cs
similarity index 94%
rename from src/JsonApiDotNetCore.Annotations/Resources/IIdentifiable.cs
rename to src/JsonApiDotNetCore.Annotations/Resources/IIdentifiable.shared.cs
index 2c6dc02025..b6dc5e3b22 100644
--- a/src/JsonApiDotNetCore.Annotations/Resources/IIdentifiable.cs
+++ b/src/JsonApiDotNetCore.Annotations/Resources/IIdentifiable.shared.cs
@@ -1,8 +1,11 @@
+using JetBrains.Annotations;
+
namespace JsonApiDotNetCore.Resources;
///
/// Defines the basic contract for a JSON:API resource. All resource classes must implement .
///
+[PublicAPI]
public interface IIdentifiable
{
///
@@ -22,6 +25,7 @@ public interface IIdentifiable
///
/// The resource identifier type.
///
+[PublicAPI]
public interface IIdentifiable : IIdentifiable
{
///
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Identifiable.netstandard.cs b/src/JsonApiDotNetCore.Annotations/Resources/Identifiable.netstandard.cs
new file mode 100644
index 0000000000..a5a7179af6
--- /dev/null
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Identifiable.netstandard.cs
@@ -0,0 +1,16 @@
+namespace JsonApiDotNetCore.Resources;
+
+///
+/// A simplified version, provided for convenience to multi-target against NetStandard. Does not actually work with JsonApiDotNetCore.
+///
+public abstract class Identifiable : IIdentifiable
+{
+ ///
+ public virtual TId Id { get; set; } = default!;
+
+ ///
+ public string? StringId { get; set; }
+
+ ///
+ public string? LocalId { get; set; }
+}
diff --git a/test/AnnotationTests/AnnotationTests.csproj b/test/AnnotationTests/AnnotationTests.csproj
new file mode 100644
index 0000000000..51df20d735
--- /dev/null
+++ b/test/AnnotationTests/AnnotationTests.csproj
@@ -0,0 +1,20 @@
+
+
+ $(TargetFrameworkName);netstandard1.0
+ latest
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/AnnotationTests/Models/HiddenNode.cs b/test/AnnotationTests/Models/HiddenNode.cs
new file mode 100644
index 0000000000..c348f3b5b0
--- /dev/null
+++ b/test/AnnotationTests/Models/HiddenNode.cs
@@ -0,0 +1,14 @@
+using JetBrains.Annotations;
+using JsonApiDotNetCore.Resources;
+using JsonApiDotNetCore.Resources.Annotations;
+
+namespace AnnotationTests.Models;
+
+[PublicAPI]
+[NoResource]
+[ResourceLinks(TopLevelLinks = LinkTypes.None, ResourceLinks = LinkTypes.None, RelationshipLinks = LinkTypes.None)]
+public sealed class HiddenNode : Identifiable
+{
+ [EagerLoad]
+ public HiddenNode? Parent { get; set; }
+}
diff --git a/test/AnnotationTests/Models/TreeNode.cs b/test/AnnotationTests/Models/TreeNode.cs
new file mode 100644
index 0000000000..955db81720
--- /dev/null
+++ b/test/AnnotationTests/Models/TreeNode.cs
@@ -0,0 +1,20 @@
+using JetBrains.Annotations;
+using JsonApiDotNetCore.Controllers;
+using JsonApiDotNetCore.Resources;
+using JsonApiDotNetCore.Resources.Annotations;
+
+namespace AnnotationTests.Models;
+
+[PublicAPI]
+[Resource(PublicName = "tree-node", ControllerNamespace = "Models", GenerateControllerEndpoints = JsonApiEndpoints.Query)]
+public sealed class TreeNode : Identifiable
+{
+ [Attr(PublicName = "name", Capabilities = AttrCapabilities.AllowSort)]
+ public string? DisplayName { get; set; }
+
+ [HasOne(PublicName = "orders", CanInclude = true, Links = LinkTypes.All)]
+ public TreeNode? Parent { get; set; }
+
+ [HasMany(PublicName = "orders", CanInclude = true, Links = LinkTypes.All)]
+ public ISet Children { get; set; } = new HashSet();
+}
From ba0278b2e678caa94a0003fc951407be2ebb13c4 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Sep 2022 00:45:00 +0200
Subject: [PATCH 05/47] Update to latest Resharper version (disabled in Ubuntu
cibuild)
---
.config/dotnet-tools.json | 2 +-
Build.ps1 | 7 +++++--
.../Configuration/ResourceGraphBuilder.cs | 2 +-
test/TestBuildingBlocks/IntegrationTest.cs | 3 +--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 3bd80e6084..d914fc369d 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
- "version": "2021.3.4",
+ "version": "2022.2.3",
"commands": [
"jb"
]
diff --git a/Build.ps1 b/Build.ps1
index 4a92feed89..daccb81df1 100644
--- a/Build.ps1
+++ b/Build.ps1
@@ -105,8 +105,11 @@ CheckLastExitCode
dotnet build -c Release
CheckLastExitCode
-RunInspectCode
-RunCleanupCode
+# https://youtrack.jetbrains.com/issue/RSRP-488628/Breaking-InspectCode-fails-with-Roslyn-Worker-process-exited-unexpectedly-after-update
+if ($env:APPVEYOR_BUILD_WORKER_IMAGE -ne 'Ubuntu') {
+ RunInspectCode
+ RunCleanupCode
+}
dotnet test -c Release --no-build --collect:"XPlat Code Coverage"
CheckLastExitCode
diff --git a/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs b/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs
index e07318c7f7..36eb9d37e8 100644
--- a/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs
+++ b/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs
@@ -317,7 +317,7 @@ private IReadOnlyCollection GetRelationships(Type resourc
private void SetPublicName(ResourceFieldAttribute field, PropertyInfo property)
{
- // ReSharper disable once ConstantNullCoalescingCondition
+ // ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
field.PublicName ??= FormatPropertyName(property);
}
diff --git a/test/TestBuildingBlocks/IntegrationTest.cs b/test/TestBuildingBlocks/IntegrationTest.cs
index 99ced55b01..4fb2e5cd26 100644
--- a/test/TestBuildingBlocks/IntegrationTest.cs
+++ b/test/TestBuildingBlocks/IntegrationTest.cs
@@ -79,8 +79,7 @@ public abstract class IntegrationTest
private string? SerializeRequest(object? requestBody)
{
- return requestBody == null ? null :
- requestBody is string stringRequestBody ? stringRequestBody : JsonSerializer.Serialize(requestBody, SerializerOptions);
+ return requestBody == null ? null : requestBody as string ?? JsonSerializer.Serialize(requestBody, SerializerOptions);
}
protected abstract HttpClient CreateClient();
From 4c61b4998861deb819b9cde19443f16560029d62 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Sep 2022 05:31:24 +0200
Subject: [PATCH 06/47] Revert workaround for bug that was fixed in recent
Resharper version
---
Build.ps1 | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Build.ps1 b/Build.ps1
index daccb81df1..d8be7da5e6 100644
--- a/Build.ps1
+++ b/Build.ps1
@@ -8,8 +8,7 @@ function CheckLastExitCode {
function RunInspectCode {
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
- # passing --build instead of --no-build as workaround for https://youtrack.jetbrains.com/issue/RSRP-487054
- dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
+ dotnet jb inspectcode JsonApiDotNetCore.sln --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
CheckLastExitCode
[xml]$xml = Get-Content "$outputPath"
From add5bdad36bdd17a563bc7a8aa7302ae9ae9f85e Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Sep 2022 00:56:34 +0200
Subject: [PATCH 07/47] Reduce the severity of 'Introduce optional parameters'
for non-private members to Hint level, because they tend to cause
backwards-compatibility issues in publicly exposed signatures
---
JsonApiDotNetCore.sln.DotSettings | 1 +
WarningSeverities.DotSettings | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/JsonApiDotNetCore.sln.DotSettings b/JsonApiDotNetCore.sln.DotSettings
index 95c0c2b7b2..a40e86f270 100644
--- a/JsonApiDotNetCore.sln.DotSettings
+++ b/JsonApiDotNetCore.sln.DotSettings
@@ -54,6 +54,7 @@ JsonApiDotNetCore.ArgumentGuard.NotNull($EXPR$, $NAME$);
WARNING
WARNING
WARNING
+ HINT
WARNING
DO_NOT_SHOW
HINT
diff --git a/WarningSeverities.DotSettings b/WarningSeverities.DotSettings
index f4a9ae32e8..0d4eeba96f 100644
--- a/WarningSeverities.DotSettings
+++ b/WarningSeverities.DotSettings
@@ -87,7 +87,6 @@
WARNING
WARNING
WARNING
- WARNING
WARNING
WARNING
WARNING
From 3a1e039674fd556e1dcab05d84e562fc9e688e57 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Sep 2022 01:28:45 +0200
Subject: [PATCH 08/47] Reduce the use of nameof() in parameter validations by
using CallerArgumentExpressionAttribute instead
---
JsonApiDotNetCore.sln.DotSettings | 19 ++++++-
.../ArgumentGuard.cs | 32 ++++-------
.../CollectionConverter.cs | 6 +-
.../Configuration/ResourceType.cs | 16 +++---
.../Annotations/RelationshipAttribute.cs | 2 +-
.../Annotations/ResourceFieldAttribute.cs | 8 +--
.../Internal/RuntimeTypeConverter.cs | 2 +-
.../TypeExtensions.cs | 4 +-
.../EntityFrameworkCoreTransaction.cs | 4 +-
.../EntityFrameworkCoreTransactionFactory.cs | 4 +-
.../AtomicOperations/LocalIdTracker.cs | 14 ++---
.../AtomicOperations/LocalIdValidator.cs | 6 +-
.../OperationProcessorAccessor.cs | 4 +-
.../AtomicOperations/OperationsProcessor.cs | 16 +++---
.../Processors/AddToRelationshipProcessor.cs | 4 +-
.../Processors/CreateProcessor.cs | 6 +-
.../Processors/DeleteProcessor.cs | 4 +-
.../RemoveFromRelationshipProcessor.cs | 4 +-
.../Processors/SetRelationshipProcessor.cs | 4 +-
.../Processors/UpdateProcessor.cs | 4 +-
.../RevertRequestStateOnDispose.cs | 2 +-
src/JsonApiDotNetCore/CollectionExtensions.cs | 8 +--
.../ApplicationBuilderExtensions.cs | 2 +-
.../InverseNavigationResolver.cs | 4 +-
.../JsonApiApplicationBuilder.cs | 8 +--
.../Configuration/JsonApiValidationFilter.cs | 2 +-
.../Configuration/ResourceDescriptor.cs | 4 +-
.../Configuration/ResourceGraph.cs | 12 ++--
.../Configuration/ResourceGraphBuilder.cs | 8 +--
.../Configuration/ResourceNameFormatter.cs | 2 +-
.../ServiceCollectionExtensions.cs | 8 +--
.../Configuration/ServiceDiscoveryFacade.cs | 8 +--
.../Configuration/TypeLocator.cs | 16 +++---
.../DisableQueryStringAttribute.cs | 2 +-
.../Controllers/BaseJsonApiController.cs | 24 ++++----
.../BaseJsonApiOperationsController.cs | 14 ++---
.../Controllers/CoreJsonApiController.cs | 4 +-
.../Diagnostics/AspNetCodeTimerSession.cs | 4 +-
.../Diagnostics/CodeTimingSessionManager.cs | 2 +-
.../Errors/InvalidModelStateException.cs | 20 +++----
.../Errors/JsonApiException.cs | 4 +-
.../Errors/MissingResourceInRelationship.cs | 6 +-
.../UnsuccessfulActionResultException.cs | 2 +-
.../AsyncConvertEmptyActionResultFilter.cs | 4 +-
.../Middleware/AsyncJsonApiExceptionFilter.cs | 4 +-
.../AsyncQueryStringActionFilter.cs | 6 +-
.../Middleware/ExceptionHandler.cs | 12 ++--
.../Middleware/HttpContextExtensions.cs | 4 +-
.../Middleware/JsonApiInputFormatter.cs | 4 +-
.../Middleware/JsonApiMiddleware.cs | 10 ++--
.../Middleware/JsonApiOutputFormatter.cs | 4 +-
.../Middleware/JsonApiRequest.cs | 2 +-
.../Middleware/JsonApiRoutingConvention.cs | 6 +-
.../Queries/ExpressionInScope.cs | 2 +-
.../Queries/Expressions/AnyExpression.cs | 4 +-
.../Expressions/ComparisonExpression.cs | 4 +-
.../Queries/Expressions/CountExpression.cs | 2 +-
.../Queries/Expressions/HasExpression.cs | 2 +-
.../Expressions/IncludeChainConverter.cs | 2 +-
.../Expressions/IncludeElementExpression.cs | 4 +-
.../Queries/Expressions/IncludeExpression.cs | 2 +-
.../Queries/Expressions/IsTypeExpression.cs | 2 +-
.../Expressions/LiteralConstantExpression.cs | 2 +-
.../Queries/Expressions/LogicalExpression.cs | 4 +-
.../Expressions/MatchTextExpression.cs | 4 +-
.../Queries/Expressions/NotExpression.cs | 2 +-
.../Expressions/PaginationExpression.cs | 2 +-
.../PaginationQueryStringValueExpression.cs | 2 +-
.../QueryStringParameterScopeExpression.cs | 2 +-
.../Expressions/QueryableHandlerExpression.cs | 2 +-
.../ResourceFieldChainExpression.cs | 4 +-
.../Expressions/SortElementExpression.cs | 4 +-
.../Queries/Expressions/SortExpression.cs | 2 +-
.../Expressions/SparseFieldSetExpression.cs | 2 +-
.../SparseFieldSetExpressionExtensions.cs | 8 +--
.../Expressions/SparseFieldTableExpression.cs | 2 +-
.../Queries/FieldSelection.cs | 2 +-
.../Queries/FieldSelectors.cs | 8 +--
.../Queries/Internal/EvaluatedIncludeCache.cs | 2 +-
.../Queries/Internal/Parsing/FilterParser.cs | 4 +-
.../Queries/Internal/Parsing/IncludeParser.cs | 4 +-
.../Internal/Parsing/PaginationParser.cs | 2 +-
.../QueryStringParameterScopeParser.cs | 2 +-
.../Internal/Parsing/QueryTokenizer.cs | 2 +-
.../Queries/Internal/Parsing/SortParser.cs | 2 +-
.../Internal/Parsing/SparseFieldSetParser.cs | 2 +-
.../Internal/Parsing/SparseFieldTypeParser.cs | 2 +-
.../Queries/Internal/QueryLayerComposer.cs | 56 +++++++++----------
.../QueryableBuilding/IncludeClauseBuilder.cs | 6 +-
.../LambdaParameterNameFactory.cs | 2 +-
.../LambdaParameterNameScope.cs | 4 +-
.../Internal/QueryableBuilding/LambdaScope.cs | 6 +-
.../QueryableBuilding/LambdaScopeFactory.cs | 4 +-
.../QueryableBuilding/OrderClauseBuilder.cs | 6 +-
.../QueryableBuilding/QueryClauseBuilder.cs | 6 +-
.../QueryableBuilding/QueryableBuilder.cs | 14 ++---
.../QueryableBuilding/SelectClauseBuilder.cs | 14 ++---
.../SkipTakeClauseBuilder.cs | 6 +-
.../QueryableBuilding/WhereClauseBuilder.cs | 8 +--
.../Queries/Internal/SparseFieldSetCache.cs | 10 ++--
src/JsonApiDotNetCore/Queries/QueryLayer.cs | 2 +-
.../FilterQueryStringParameterReader.cs | 6 +-
.../IncludeQueryStringParameterReader.cs | 4 +-
.../Internal/LegacyFilterNotationConverter.cs | 6 +-
.../PaginationQueryStringParameterReader.cs | 4 +-
.../Internal/QueryStringParameterReader.cs | 4 +-
.../Internal/QueryStringReader.cs | 8 +--
.../Internal/RequestQueryStringAccessor.cs | 2 +-
...ourceDefinitionQueryableParameterReader.cs | 4 +-
.../SortQueryStringParameterReader.cs | 4 +-
...parseFieldSetQueryStringParameterReader.cs | 4 +-
.../Repositories/DbContextExtensions.cs | 10 ++--
.../Repositories/DbContextResolver.cs | 2 +-
.../EntityFrameworkCoreRepository.cs | 36 ++++++------
.../ResourceRepositoryAccessor.cs | 8 +--
.../Resources/AbstractResourceWrapper.cs | 2 +-
.../Resources/IdentifiableExtensions.cs | 4 +-
.../Resources/JsonApiResourceDefinition.cs | 4 +-
.../Resources/OperationContainer.cs | 8 +--
.../Resources/ResourceChangeTracker.cs | 10 ++--
.../Resources/ResourceDefinitionAccessor.cs | 50 ++++++++---------
.../Resources/ResourceFactory.cs | 6 +-
.../SortExpressionLambdaConverter.cs | 4 +-
.../JsonConverters/ResourceObjectConverter.cs | 2 +-
.../Adapters/AtomicOperationObjectAdapter.cs | 8 +--
.../Adapters/AtomicReferenceAdapter.cs | 6 +-
.../Request/Adapters/AtomicReferenceResult.cs | 4 +-
.../Request/Adapters/DocumentAdapter.cs | 10 ++--
.../DocumentInOperationsRequestAdapter.cs | 6 +-
...tInResourceOrRelationshipRequestAdapter.cs | 6 +-
.../Adapters/RelationshipDataAdapter.cs | 6 +-
.../Adapters/RequestAdapterPosition.cs | 2 +-
.../Request/Adapters/RequestAdapterState.cs | 4 +-
.../Request/Adapters/ResourceDataAdapter.cs | 8 +--
.../ResourceIdentifierObjectAdapter.cs | 6 +-
.../Adapters/ResourceIdentityAdapter.cs | 10 ++--
.../Request/Adapters/ResourceObjectAdapter.cs | 10 ++--
.../Serialization/Request/JsonApiReader.cs | 8 +--
.../Request/JsonInvalidAttributeInfo.cs | 4 +-
.../Request/ModelConversionException.cs | 2 +-
.../Serialization/Response/ETagGenerator.cs | 2 +-
.../Response/FingerprintGenerator.cs | 2 +-
.../Serialization/Response/JsonApiWriter.cs | 14 ++---
.../Serialization/Response/LinkBuilder.cs | 18 +++---
.../Serialization/Response/MetaBuilder.cs | 8 +--
.../Response/ResourceObjectTreeNode.cs | 14 ++---
.../Response/ResponseModelAdapter.cs | 16 +++---
.../Services/AsyncCollectionExtensions.cs | 6 +-
.../Services/JsonApiResourceService.cs | 32 +++++------
.../MusicTrackReleaseDefinition.cs | 2 +-
.../EagerLoading/BuildingDefinition.cs | 2 +-
.../HitCountingResourceDefinition.cs | 2 +-
.../InjectionDbContext.cs | 2 +-
.../InjectionFakers.cs | 2 +-
.../ResourceTypeCapturingDefinition.cs | 4 +-
.../WheelSortDefinition.cs | 2 +-
.../DependencyContainerRegistrationTests.cs | 6 +-
.../ServiceCollectionExtensions.cs | 2 +-
.../ResourceConstructionExpressionTests.cs | 2 +-
159 files changed, 529 insertions(+), 528 deletions(-)
diff --git a/JsonApiDotNetCore.sln.DotSettings b/JsonApiDotNetCore.sln.DotSettings
index a40e86f270..1ffdf4a909 100644
--- a/JsonApiDotNetCore.sln.DotSettings
+++ b/JsonApiDotNetCore.sln.DotSettings
@@ -600,12 +600,12 @@ JsonApiDotNetCore.ArgumentGuard.NotNull($EXPR$, $NAME$);
CSHARP
False
Replace argument null check with Guard clause
- JsonApiDotNetCore.ArgumentGuard.NotNull($argument$, nameof($argument$));
+ JsonApiDotNetCore.ArgumentGuard.NotNull($argument$);
$left$ = $right$;
$left$ = $right$ ?? throw new ArgumentNullException(nameof($argument$));
WARNING
True
- Replace classic argument null check with Guard clause
+ Replace argument == null check with Guard clause
True
True
False
@@ -615,7 +615,7 @@ $left$ = $right$;
CSHARP
False
Replace argument null check with Guard clause
- JsonApiDotNetCore.ArgumentGuard.NotNull($argument$, nameof($argument$));
+ JsonApiDotNetCore.ArgumentGuard.NotNull($argument$);
if ($argument$ == null) throw new ArgumentNullException(nameof($argument$));
WARNING
True
@@ -631,6 +631,19 @@ $left$ = $right$;
$collection$.IsNullOrEmpty()
$collection$ == null || !$collection$.Any()
WARNING
+ True
+ Replace argument is null check with Guard clause
+ True
+ True
+ False
+
+ IdentifierPlaceholder
+ True
+ CSHARP
+ False
+ JsonApiDotNetCore.ArgumentGuard.NotNull($argument$);
+ if ($argument$ is null) throw new ArgumentNullException(nameof($argument$));
+ WARNING
True
True
True
diff --git a/src/JsonApiDotNetCore.Annotations/ArgumentGuard.cs b/src/JsonApiDotNetCore.Annotations/ArgumentGuard.cs
index be336e56a0..e0c786a106 100644
--- a/src/JsonApiDotNetCore.Annotations/ArgumentGuard.cs
+++ b/src/JsonApiDotNetCore.Annotations/ArgumentGuard.cs
@@ -1,52 +1,40 @@
+using System.Runtime.CompilerServices;
using JetBrains.Annotations;
using SysNotNull = System.Diagnostics.CodeAnalysis.NotNullAttribute;
#pragma warning disable AV1008 // Class should not be static
+#pragma warning disable AV1553 // Do not use optional parameters with default value null for strings, collections or tasks
namespace JsonApiDotNetCore;
internal static class ArgumentGuard
{
[AssertionMethod]
- public static void NotNull([NoEnumeration] [SysNotNull] T? value, [InvokerParameterName] string name)
+ public static void NotNull([NoEnumeration] [SysNotNull] T? value, [CallerArgumentExpression("value")] string? parameterName = null)
where T : class
{
- if (value is null)
- {
- throw new ArgumentNullException(name);
- }
- }
-
- [AssertionMethod]
- public static void NotNullNorEmpty([SysNotNull] IEnumerable? value, [InvokerParameterName] string name)
- {
- NotNull(value, name);
-
- if (!value.Any())
- {
- throw new ArgumentException($"Must have one or more {name}.", name);
- }
+ ArgumentNullException.ThrowIfNull(value, parameterName);
}
[AssertionMethod]
- public static void NotNullNorEmpty([SysNotNull] IEnumerable? value, [InvokerParameterName] string name, string collectionName)
+ public static void NotNullNorEmpty([SysNotNull] IEnumerable? value, [CallerArgumentExpression("value")] string? parameterName = null)
{
- NotNull(value, name);
+ ArgumentNullException.ThrowIfNull(value, parameterName);
if (!value.Any())
{
- throw new ArgumentException($"Must have one or more {collectionName}.", name);
+ throw new ArgumentException("Collection cannot be null or empty.", parameterName);
}
}
[AssertionMethod]
- public static void NotNullNorEmpty([SysNotNull] string? value, [InvokerParameterName] string name)
+ public static void NotNullNorEmpty([SysNotNull] string? value, [CallerArgumentExpression("value")] string? parameterName = null)
{
- NotNull(value, name);
+ ArgumentNullException.ThrowIfNull(value, parameterName);
if (value == string.Empty)
{
- throw new ArgumentException("String cannot be null or empty.", name);
+ throw new ArgumentException("String cannot be null or empty.", parameterName);
}
}
}
diff --git a/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs b/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs
index a308607c3b..fa1c0c90bd 100644
--- a/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs
+++ b/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs
@@ -26,8 +26,8 @@ internal sealed class CollectionConverter
///
public IEnumerable CopyToTypedCollection(IEnumerable source, Type collectionType)
{
- ArgumentGuard.NotNull(source, nameof(source));
- ArgumentGuard.NotNull(collectionType, nameof(collectionType));
+ ArgumentGuard.NotNull(source);
+ ArgumentGuard.NotNull(collectionType);
Type concreteCollectionType = ToConcreteCollectionType(collectionType);
dynamic concreteCollectionInstance = Activator.CreateInstance(concreteCollectionType)!;
@@ -121,7 +121,7 @@ public IReadOnlyCollection ExtractResources(object? value)
///
public bool TypeCanContainHashSet(Type collectionType)
{
- ArgumentGuard.NotNull(collectionType, nameof(collectionType));
+ ArgumentGuard.NotNull(collectionType);
if (collectionType.IsGenericType)
{
diff --git a/src/JsonApiDotNetCore.Annotations/Configuration/ResourceType.cs b/src/JsonApiDotNetCore.Annotations/Configuration/ResourceType.cs
index 515dfe8a63..0263958b00 100644
--- a/src/JsonApiDotNetCore.Annotations/Configuration/ResourceType.cs
+++ b/src/JsonApiDotNetCore.Annotations/Configuration/ResourceType.cs
@@ -100,9 +100,9 @@ public ResourceType(string publicName, Type clrType, Type identityClrType, IRead
LinkTypes topLevelLinks = LinkTypes.NotConfigured, LinkTypes resourceLinks = LinkTypes.NotConfigured,
LinkTypes relationshipLinks = LinkTypes.NotConfigured)
{
- ArgumentGuard.NotNullNorEmpty(publicName, nameof(publicName));
- ArgumentGuard.NotNull(clrType, nameof(clrType));
- ArgumentGuard.NotNull(identityClrType, nameof(identityClrType));
+ ArgumentGuard.NotNullNorEmpty(publicName);
+ ArgumentGuard.NotNull(clrType);
+ ArgumentGuard.NotNull(identityClrType);
PublicName = publicName;
ClrType = clrType;
@@ -153,7 +153,7 @@ public AttrAttribute GetAttributeByPublicName(string publicName)
public AttrAttribute? FindAttributeByPublicName(string publicName)
{
- ArgumentGuard.NotNull(publicName, nameof(publicName));
+ ArgumentGuard.NotNull(publicName);
return _fieldsByPublicName.TryGetValue(publicName, out ResourceFieldAttribute? field) && field is AttrAttribute attribute ? attribute : null;
}
@@ -167,7 +167,7 @@ public AttrAttribute GetAttributeByPropertyName(string propertyName)
public AttrAttribute? FindAttributeByPropertyName(string propertyName)
{
- ArgumentGuard.NotNull(propertyName, nameof(propertyName));
+ ArgumentGuard.NotNull(propertyName);
return _fieldsByPropertyName.TryGetValue(propertyName, out ResourceFieldAttribute? field) && field is AttrAttribute attribute ? attribute : null;
}
@@ -180,7 +180,7 @@ public RelationshipAttribute GetRelationshipByPublicName(string publicName)
public RelationshipAttribute? FindRelationshipByPublicName(string publicName)
{
- ArgumentGuard.NotNull(publicName, nameof(publicName));
+ ArgumentGuard.NotNull(publicName);
return _fieldsByPublicName.TryGetValue(publicName, out ResourceFieldAttribute? field) && field is RelationshipAttribute relationship
? relationship
@@ -197,7 +197,7 @@ public RelationshipAttribute GetRelationshipByPropertyName(string propertyName)
public RelationshipAttribute? FindRelationshipByPropertyName(string propertyName)
{
- ArgumentGuard.NotNull(propertyName, nameof(propertyName));
+ ArgumentGuard.NotNull(propertyName);
return _fieldsByPropertyName.TryGetValue(propertyName, out ResourceFieldAttribute? field) && field is RelationshipAttribute relationship
? relationship
@@ -217,7 +217,7 @@ public IReadOnlySet GetAllConcreteDerivedTypes()
///
public ResourceType GetTypeOrDerived(Type clrType)
{
- ArgumentGuard.NotNull(clrType, nameof(clrType));
+ ArgumentGuard.NotNull(clrType);
ResourceType? derivedType = FindTypeOrDerived(this, clrType);
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.cs
index 11320a7abc..c1b24e9567 100644
--- a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.cs
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.cs
@@ -57,7 +57,7 @@ public ResourceType RightType
get => _rightType!;
internal set
{
- ArgumentGuard.NotNull(value, nameof(value));
+ ArgumentGuard.NotNull(value);
_rightType = value;
}
}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.cs
index 599b17a42a..9f32610dc9 100644
--- a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.cs
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.cs
@@ -43,7 +43,7 @@ public PropertyInfo Property
get => _property!;
internal set
{
- ArgumentGuard.NotNull(value, nameof(value));
+ ArgumentGuard.NotNull(value);
_property = value;
}
}
@@ -56,7 +56,7 @@ public ResourceType Type
get => _type!;
internal set
{
- ArgumentGuard.NotNull(value, nameof(value));
+ ArgumentGuard.NotNull(value);
_type = value;
}
}
@@ -67,7 +67,7 @@ internal set
///
public object? GetValue(object resource)
{
- ArgumentGuard.NotNull(resource, nameof(resource));
+ ArgumentGuard.NotNull(resource);
if (Property.GetMethod == null)
{
@@ -92,7 +92,7 @@ internal set
///
public void SetValue(object resource, object? newValue)
{
- ArgumentGuard.NotNull(resource, nameof(resource));
+ ArgumentGuard.NotNull(resource);
if (Property.SetMethod == null)
{
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs b/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs
index 8722458938..d79ed4c635 100644
--- a/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs
@@ -10,7 +10,7 @@ public static class RuntimeTypeConverter
{
public static object? ConvertType(object? value, Type type)
{
- ArgumentGuard.NotNull(type, nameof(type));
+ ArgumentGuard.NotNull(type);
if (value == null)
{
diff --git a/src/JsonApiDotNetCore.Annotations/TypeExtensions.cs b/src/JsonApiDotNetCore.Annotations/TypeExtensions.cs
index c28ea84332..b31f82d48e 100644
--- a/src/JsonApiDotNetCore.Annotations/TypeExtensions.cs
+++ b/src/JsonApiDotNetCore.Annotations/TypeExtensions.cs
@@ -15,7 +15,7 @@ public static bool IsOrImplementsInterface(this Type? source)
///
private static bool IsOrImplementsInterface(this Type? source, Type interfaceType)
{
- ArgumentGuard.NotNull(interfaceType, nameof(interfaceType));
+ ArgumentGuard.NotNull(interfaceType);
if (source == null)
{
@@ -41,7 +41,7 @@ private static bool AreTypesEqual(Type left, Type right, bool isLeftGeneric)
///
public static string GetFriendlyTypeName(this Type type)
{
- ArgumentGuard.NotNull(type, nameof(type));
+ ArgumentGuard.NotNull(type);
// Based on https://stackoverflow.com/questions/2581642/how-do-i-get-the-type-name-of-a-generic-type-argument.
diff --git a/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransaction.cs b/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransaction.cs
index be5125c414..f59f86162d 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransaction.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransaction.cs
@@ -19,8 +19,8 @@ public sealed class EntityFrameworkCoreTransaction : IOperationsTransaction
public EntityFrameworkCoreTransaction(IDbContextTransaction transaction, DbContext dbContext)
{
- ArgumentGuard.NotNull(transaction, nameof(transaction));
- ArgumentGuard.NotNull(dbContext, nameof(dbContext));
+ ArgumentGuard.NotNull(transaction);
+ ArgumentGuard.NotNull(dbContext);
_transaction = transaction;
_dbContext = dbContext;
diff --git a/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransactionFactory.cs b/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransactionFactory.cs
index 96c66e12ab..8ef44cb627 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransactionFactory.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransactionFactory.cs
@@ -15,8 +15,8 @@ public sealed class EntityFrameworkCoreTransactionFactory : IOperationsTransacti
public EntityFrameworkCoreTransactionFactory(IDbContextResolver dbContextResolver, IJsonApiOptions options)
{
- ArgumentGuard.NotNull(dbContextResolver, nameof(dbContextResolver));
- ArgumentGuard.NotNull(options, nameof(options));
+ ArgumentGuard.NotNull(dbContextResolver);
+ ArgumentGuard.NotNull(options);
_dbContextResolver = dbContextResolver;
_options = options;
diff --git a/src/JsonApiDotNetCore/AtomicOperations/LocalIdTracker.cs b/src/JsonApiDotNetCore/AtomicOperations/LocalIdTracker.cs
index b0a1b3ee2f..2def7bfecc 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/LocalIdTracker.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/LocalIdTracker.cs
@@ -17,8 +17,8 @@ public void Reset()
///
public void Declare(string localId, ResourceType resourceType)
{
- ArgumentGuard.NotNullNorEmpty(localId, nameof(localId));
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNullNorEmpty(localId);
+ ArgumentGuard.NotNull(resourceType);
AssertIsNotDeclared(localId);
@@ -36,9 +36,9 @@ private void AssertIsNotDeclared(string localId)
///
public void Assign(string localId, ResourceType resourceType, string stringId)
{
- ArgumentGuard.NotNullNorEmpty(localId, nameof(localId));
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
- ArgumentGuard.NotNullNorEmpty(stringId, nameof(stringId));
+ ArgumentGuard.NotNullNorEmpty(localId);
+ ArgumentGuard.NotNull(resourceType);
+ ArgumentGuard.NotNullNorEmpty(stringId);
AssertIsDeclared(localId);
@@ -57,8 +57,8 @@ public void Assign(string localId, ResourceType resourceType, string stringId)
///
public string GetValue(string localId, ResourceType resourceType)
{
- ArgumentGuard.NotNullNorEmpty(localId, nameof(localId));
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNullNorEmpty(localId);
+ ArgumentGuard.NotNull(resourceType);
AssertIsDeclared(localId);
diff --git a/src/JsonApiDotNetCore/AtomicOperations/LocalIdValidator.cs b/src/JsonApiDotNetCore/AtomicOperations/LocalIdValidator.cs
index 9cb463ab10..fb75fe3c7f 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/LocalIdValidator.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/LocalIdValidator.cs
@@ -18,8 +18,8 @@ public sealed class LocalIdValidator
public LocalIdValidator(ILocalIdTracker localIdTracker, IResourceGraph resourceGraph)
{
- ArgumentGuard.NotNull(localIdTracker, nameof(localIdTracker));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
+ ArgumentGuard.NotNull(localIdTracker);
+ ArgumentGuard.NotNull(resourceGraph);
_localIdTracker = localIdTracker;
_resourceGraph = resourceGraph;
@@ -27,7 +27,7 @@ public LocalIdValidator(ILocalIdTracker localIdTracker, IResourceGraph resourceG
public void Validate(IEnumerable operations)
{
- ArgumentGuard.NotNull(operations, nameof(operations));
+ ArgumentGuard.NotNull(operations);
_localIdTracker.Reset();
diff --git a/src/JsonApiDotNetCore/AtomicOperations/OperationProcessorAccessor.cs b/src/JsonApiDotNetCore/AtomicOperations/OperationProcessorAccessor.cs
index c032f78f8d..c2397267b3 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/OperationProcessorAccessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/OperationProcessorAccessor.cs
@@ -15,7 +15,7 @@ public class OperationProcessorAccessor : IOperationProcessorAccessor
public OperationProcessorAccessor(IServiceProvider serviceProvider)
{
- ArgumentGuard.NotNull(serviceProvider, nameof(serviceProvider));
+ ArgumentGuard.NotNull(serviceProvider);
_serviceProvider = serviceProvider;
}
@@ -23,7 +23,7 @@ public OperationProcessorAccessor(IServiceProvider serviceProvider)
///
public Task ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operation, nameof(operation));
+ ArgumentGuard.NotNull(operation);
IOperationProcessor processor = ResolveProcessor(operation);
return processor.ProcessAsync(operation, cancellationToken);
diff --git a/src/JsonApiDotNetCore/AtomicOperations/OperationsProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/OperationsProcessor.cs
index 6524252abf..6ecdfd6077 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/OperationsProcessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/OperationsProcessor.cs
@@ -25,13 +25,13 @@ public OperationsProcessor(IOperationProcessorAccessor operationProcessorAccesso
ILocalIdTracker localIdTracker, IResourceGraph resourceGraph, IJsonApiRequest request, ITargetedFields targetedFields,
ISparseFieldSetCache sparseFieldSetCache)
{
- ArgumentGuard.NotNull(operationProcessorAccessor, nameof(operationProcessorAccessor));
- ArgumentGuard.NotNull(operationsTransactionFactory, nameof(operationsTransactionFactory));
- ArgumentGuard.NotNull(localIdTracker, nameof(localIdTracker));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
- ArgumentGuard.NotNull(request, nameof(request));
- ArgumentGuard.NotNull(targetedFields, nameof(targetedFields));
- ArgumentGuard.NotNull(sparseFieldSetCache, nameof(sparseFieldSetCache));
+ ArgumentGuard.NotNull(operationProcessorAccessor);
+ ArgumentGuard.NotNull(operationsTransactionFactory);
+ ArgumentGuard.NotNull(localIdTracker);
+ ArgumentGuard.NotNull(resourceGraph);
+ ArgumentGuard.NotNull(request);
+ ArgumentGuard.NotNull(targetedFields);
+ ArgumentGuard.NotNull(sparseFieldSetCache);
_operationProcessorAccessor = operationProcessorAccessor;
_operationsTransactionFactory = operationsTransactionFactory;
@@ -46,7 +46,7 @@ public OperationsProcessor(IOperationProcessorAccessor operationProcessorAccesso
///
public virtual async Task> ProcessAsync(IList operations, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operations, nameof(operations));
+ ArgumentGuard.NotNull(operations);
_localIdValidator.Validate(operations);
_localIdTracker.Reset();
diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs
index fc16847eec..c8997be8cd 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/AddToRelationshipProcessor.cs
@@ -13,7 +13,7 @@ public class AddToRelationshipProcessor : IAddToRelationshipProc
public AddToRelationshipProcessor(IAddToRelationshipService service)
{
- ArgumentGuard.NotNull(service, nameof(service));
+ ArgumentGuard.NotNull(service);
_service = service;
}
@@ -21,7 +21,7 @@ public AddToRelationshipProcessor(IAddToRelationshipService serv
///
public virtual async Task ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operation, nameof(operation));
+ ArgumentGuard.NotNull(operation);
var leftId = (TId)operation.Resource.GetTypedId();
ISet rightResourceIds = operation.GetSecondaryResources();
diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/CreateProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/CreateProcessor.cs
index b06ebd626e..e105f54a50 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/Processors/CreateProcessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/CreateProcessor.cs
@@ -14,8 +14,8 @@ public class CreateProcessor : ICreateProcessor
public CreateProcessor(ICreateService service, ILocalIdTracker localIdTracker)
{
- ArgumentGuard.NotNull(service, nameof(service));
- ArgumentGuard.NotNull(localIdTracker, nameof(localIdTracker));
+ ArgumentGuard.NotNull(service);
+ ArgumentGuard.NotNull(localIdTracker);
_service = service;
_localIdTracker = localIdTracker;
@@ -24,7 +24,7 @@ public CreateProcessor(ICreateService service, ILocalIdTracker l
///
public virtual async Task ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operation, nameof(operation));
+ ArgumentGuard.NotNull(operation);
TResource? newResource = await _service.CreateAsync((TResource)operation.Resource, cancellationToken);
diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs
index e4001b75c1..356742f9b7 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/DeleteProcessor.cs
@@ -13,7 +13,7 @@ public class DeleteProcessor : IDeleteProcessor
public DeleteProcessor(IDeleteService service)
{
- ArgumentGuard.NotNull(service, nameof(service));
+ ArgumentGuard.NotNull(service);
_service = service;
}
@@ -21,7 +21,7 @@ public DeleteProcessor(IDeleteService service)
///
public virtual async Task ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operation, nameof(operation));
+ ArgumentGuard.NotNull(operation);
var id = (TId)operation.Resource.GetTypedId();
await _service.DeleteAsync(id, cancellationToken);
diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs
index 493ed2066f..b308d6935a 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/RemoveFromRelationshipProcessor.cs
@@ -13,7 +13,7 @@ public class RemoveFromRelationshipProcessor : IRemoveFromRelati
public RemoveFromRelationshipProcessor(IRemoveFromRelationshipService service)
{
- ArgumentGuard.NotNull(service, nameof(service));
+ ArgumentGuard.NotNull(service);
_service = service;
}
@@ -21,7 +21,7 @@ public RemoveFromRelationshipProcessor(IRemoveFromRelationshipService
public virtual async Task ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operation, nameof(operation));
+ ArgumentGuard.NotNull(operation);
var leftId = (TId)operation.Resource.GetTypedId();
ISet rightResourceIds = operation.GetSecondaryResources();
diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs
index 5eb09ccbc3..083bd0d0fc 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/SetRelationshipProcessor.cs
@@ -15,7 +15,7 @@ public class SetRelationshipProcessor : ISetRelationshipProcesso
public SetRelationshipProcessor(ISetRelationshipService service)
{
- ArgumentGuard.NotNull(service, nameof(service));
+ ArgumentGuard.NotNull(service);
_service = service;
}
@@ -23,7 +23,7 @@ public SetRelationshipProcessor(ISetRelationshipService service)
///
public virtual async Task ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operation, nameof(operation));
+ ArgumentGuard.NotNull(operation);
var leftId = (TId)operation.Resource.GetTypedId();
object? rightValue = GetRelationshipRightValue(operation);
diff --git a/src/JsonApiDotNetCore/AtomicOperations/Processors/UpdateProcessor.cs b/src/JsonApiDotNetCore/AtomicOperations/Processors/UpdateProcessor.cs
index a02ac2d3ff..5611f8d1c2 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/Processors/UpdateProcessor.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/Processors/UpdateProcessor.cs
@@ -13,7 +13,7 @@ public class UpdateProcessor : IUpdateProcessor
public UpdateProcessor(IUpdateService service)
{
- ArgumentGuard.NotNull(service, nameof(service));
+ ArgumentGuard.NotNull(service);
_service = service;
}
@@ -21,7 +21,7 @@ public UpdateProcessor(IUpdateService service)
///
public virtual async Task ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
{
- ArgumentGuard.NotNull(operation, nameof(operation));
+ ArgumentGuard.NotNull(operation);
var resource = (TResource)operation.Resource;
TResource? updated = await _service.UpdateAsync(resource.Id, resource, cancellationToken);
diff --git a/src/JsonApiDotNetCore/AtomicOperations/RevertRequestStateOnDispose.cs b/src/JsonApiDotNetCore/AtomicOperations/RevertRequestStateOnDispose.cs
index 453f78f1f2..1951333d0c 100644
--- a/src/JsonApiDotNetCore/AtomicOperations/RevertRequestStateOnDispose.cs
+++ b/src/JsonApiDotNetCore/AtomicOperations/RevertRequestStateOnDispose.cs
@@ -16,7 +16,7 @@ internal sealed class RevertRequestStateOnDispose : IDisposable
public RevertRequestStateOnDispose(IJsonApiRequest request, ITargetedFields? targetedFields)
{
- ArgumentGuard.NotNull(request, nameof(request));
+ ArgumentGuard.NotNull(request);
_sourceRequest = request;
_backupRequest.CopyFrom(request);
diff --git a/src/JsonApiDotNetCore/CollectionExtensions.cs b/src/JsonApiDotNetCore/CollectionExtensions.cs
index a7f5e72ab6..133231eb23 100644
--- a/src/JsonApiDotNetCore/CollectionExtensions.cs
+++ b/src/JsonApiDotNetCore/CollectionExtensions.cs
@@ -18,8 +18,8 @@ public static bool IsNullOrEmpty([NotNullWhen(false)] this IEnumerable? so
public static int FindIndex(this IReadOnlyList source, Predicate match)
{
- ArgumentGuard.NotNull(source, nameof(source));
- ArgumentGuard.NotNull(match, nameof(match));
+ ArgumentGuard.NotNull(source);
+ ArgumentGuard.NotNull(match);
for (int index = 0; index < source.Count; index++)
{
@@ -82,8 +82,8 @@ public static IEnumerable WhereNotNull(this IEnumerable source)
public static void AddRange(this ICollection source, IEnumerable itemsToAdd)
{
- ArgumentGuard.NotNull(source, nameof(source));
- ArgumentGuard.NotNull(itemsToAdd, nameof(itemsToAdd));
+ ArgumentGuard.NotNull(source);
+ ArgumentGuard.NotNull(itemsToAdd);
foreach (T item in itemsToAdd)
{
diff --git a/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs b/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs
index a941e27218..8ed4e42a42 100644
--- a/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs
+++ b/src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs
@@ -22,7 +22,7 @@ public static class ApplicationBuilderExtensions
///
public static void UseJsonApi(this IApplicationBuilder builder)
{
- ArgumentGuard.NotNull(builder, nameof(builder));
+ ArgumentGuard.NotNull(builder);
using (IServiceScope scope = builder.ApplicationServices.CreateScope())
{
diff --git a/src/JsonApiDotNetCore/Configuration/InverseNavigationResolver.cs b/src/JsonApiDotNetCore/Configuration/InverseNavigationResolver.cs
index 8e5f3f15a3..821be639f9 100644
--- a/src/JsonApiDotNetCore/Configuration/InverseNavigationResolver.cs
+++ b/src/JsonApiDotNetCore/Configuration/InverseNavigationResolver.cs
@@ -15,8 +15,8 @@ public sealed class InverseNavigationResolver : IInverseNavigationResolver
public InverseNavigationResolver(IResourceGraph resourceGraph, IEnumerable dbContextResolvers)
{
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
- ArgumentGuard.NotNull(dbContextResolvers, nameof(dbContextResolvers));
+ ArgumentGuard.NotNull(resourceGraph);
+ ArgumentGuard.NotNull(dbContextResolvers);
_resourceGraph = resourceGraph;
_dbContextResolvers = dbContextResolvers;
diff --git a/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs b/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs
index 7cd4307ad1..82e0ff52e1 100644
--- a/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs
+++ b/src/JsonApiDotNetCore/Configuration/JsonApiApplicationBuilder.cs
@@ -39,8 +39,8 @@ internal sealed class JsonApiApplicationBuilder : IJsonApiApplicationBuilder, ID
public JsonApiApplicationBuilder(IServiceCollection services, IMvcCoreBuilder mvcBuilder)
{
- ArgumentGuard.NotNull(services, nameof(services));
- ArgumentGuard.NotNull(mvcBuilder, nameof(mvcBuilder));
+ ArgumentGuard.NotNull(services);
+ ArgumentGuard.NotNull(mvcBuilder);
_services = services;
_mvcBuilder = mvcBuilder;
@@ -73,7 +73,7 @@ public void ConfigureAutoDiscovery(Action? configureAuto
///
public void ConfigureResourceGraph(ICollection dbContextTypes, Action? configureResourceGraph)
{
- ArgumentGuard.NotNull(dbContextTypes, nameof(dbContextTypes));
+ ArgumentGuard.NotNull(dbContextTypes);
_serviceDiscoveryFacade.DiscoverResources();
@@ -126,7 +126,7 @@ public void DiscoverInjectables()
///
public void ConfigureServiceContainer(ICollection dbContextTypes)
{
- ArgumentGuard.NotNull(dbContextTypes, nameof(dbContextTypes));
+ ArgumentGuard.NotNull(dbContextTypes);
if (dbContextTypes.Any())
{
diff --git a/src/JsonApiDotNetCore/Configuration/JsonApiValidationFilter.cs b/src/JsonApiDotNetCore/Configuration/JsonApiValidationFilter.cs
index 6b193bdc6f..a27acf8ebd 100644
--- a/src/JsonApiDotNetCore/Configuration/JsonApiValidationFilter.cs
+++ b/src/JsonApiDotNetCore/Configuration/JsonApiValidationFilter.cs
@@ -15,7 +15,7 @@ internal sealed class JsonApiValidationFilter : IPropertyValidationFilter
public JsonApiValidationFilter(IHttpContextAccessor httpContextAccessor)
{
- ArgumentGuard.NotNull(httpContextAccessor, nameof(httpContextAccessor));
+ ArgumentGuard.NotNull(httpContextAccessor);
_httpContextAccessor = httpContextAccessor;
}
diff --git a/src/JsonApiDotNetCore/Configuration/ResourceDescriptor.cs b/src/JsonApiDotNetCore/Configuration/ResourceDescriptor.cs
index 8747cdd18f..885f67567c 100644
--- a/src/JsonApiDotNetCore/Configuration/ResourceDescriptor.cs
+++ b/src/JsonApiDotNetCore/Configuration/ResourceDescriptor.cs
@@ -7,8 +7,8 @@ internal sealed class ResourceDescriptor
public ResourceDescriptor(Type resourceClrType, Type idClrType)
{
- ArgumentGuard.NotNull(resourceClrType, nameof(resourceClrType));
- ArgumentGuard.NotNull(idClrType, nameof(idClrType));
+ ArgumentGuard.NotNull(resourceClrType);
+ ArgumentGuard.NotNull(idClrType);
ResourceClrType = resourceClrType;
IdClrType = idClrType;
diff --git a/src/JsonApiDotNetCore/Configuration/ResourceGraph.cs b/src/JsonApiDotNetCore/Configuration/ResourceGraph.cs
index d693fa2c3c..0dbaeb9623 100644
--- a/src/JsonApiDotNetCore/Configuration/ResourceGraph.cs
+++ b/src/JsonApiDotNetCore/Configuration/ResourceGraph.cs
@@ -18,7 +18,7 @@ public sealed class ResourceGraph : IResourceGraph
public ResourceGraph(IReadOnlySet resourceTypeSet)
{
- ArgumentGuard.NotNull(resourceTypeSet, nameof(resourceTypeSet));
+ ArgumentGuard.NotNull(resourceTypeSet);
_resourceTypeSet = resourceTypeSet;
@@ -51,7 +51,7 @@ public ResourceType GetResourceType(string publicName)
///
public ResourceType? FindResourceType(string publicName)
{
- ArgumentGuard.NotNull(publicName, nameof(publicName));
+ ArgumentGuard.NotNull(publicName);
return _resourceTypesByPublicName.TryGetValue(publicName, out ResourceType? resourceType) ? resourceType : null;
}
@@ -72,7 +72,7 @@ public ResourceType GetResourceType(Type resourceClrType)
///
public ResourceType? FindResourceType(Type resourceClrType)
{
- ArgumentGuard.NotNull(resourceClrType, nameof(resourceClrType));
+ ArgumentGuard.NotNull(resourceClrType);
Type typeToFind = IsLazyLoadingProxyForResourceType(resourceClrType) ? resourceClrType.BaseType! : resourceClrType;
return _resourceTypesByClrType.TryGetValue(typeToFind, out ResourceType? resourceType) ? resourceType : null;
@@ -94,7 +94,7 @@ public ResourceType GetResourceType()
public IReadOnlyCollection GetFields(Expression> selector)
where TResource : class, IIdentifiable
{
- ArgumentGuard.NotNull(selector, nameof(selector));
+ ArgumentGuard.NotNull(selector);
return FilterFields(selector);
}
@@ -103,7 +103,7 @@ public IReadOnlyCollection GetFields(Expressi
public IReadOnlyCollection GetAttributes(Expression> selector)
where TResource : class, IIdentifiable
{
- ArgumentGuard.NotNull(selector, nameof(selector));
+ ArgumentGuard.NotNull(selector);
return FilterFields(selector);
}
@@ -112,7 +112,7 @@ public IReadOnlyCollection GetAttributes(Expression GetRelationships(Expression> selector)
where TResource : class, IIdentifiable
{
- ArgumentGuard.NotNull(selector, nameof(selector));
+ ArgumentGuard.NotNull(selector);
return FilterFields(selector);
}
diff --git a/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs b/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs
index 36eb9d37e8..2af0e63caf 100644
--- a/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs
+++ b/src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs
@@ -22,8 +22,8 @@ public class ResourceGraphBuilder
public ResourceGraphBuilder(IJsonApiOptions options, ILoggerFactory loggerFactory)
{
- ArgumentGuard.NotNull(options, nameof(options));
- ArgumentGuard.NotNull(loggerFactory, nameof(loggerFactory));
+ ArgumentGuard.NotNull(options);
+ ArgumentGuard.NotNull(loggerFactory);
_options = options;
_logger = loggerFactory.CreateLogger();
@@ -144,7 +144,7 @@ private static void ValidateRelationshipsInDerivedType(ResourceType resourceType
public ResourceGraphBuilder Add(DbContext dbContext)
{
- ArgumentGuard.NotNull(dbContext, nameof(dbContext));
+ ArgumentGuard.NotNull(dbContext);
foreach (IEntityType entityType in dbContext.Model.GetEntityTypes())
{
@@ -200,7 +200,7 @@ public ResourceGraphBuilder Add(string? publicName = null)
public ResourceGraphBuilder Add(Type resourceClrType, Type? idClrType = null, string? publicName = null)
#pragma warning restore AV1553 // Do not use optional parameters with default value null for strings, collections or tasks
{
- ArgumentGuard.NotNull(resourceClrType, nameof(resourceClrType));
+ ArgumentGuard.NotNull(resourceClrType);
if (_resourceTypesByClrType.ContainsKey(resourceClrType))
{
diff --git a/src/JsonApiDotNetCore/Configuration/ResourceNameFormatter.cs b/src/JsonApiDotNetCore/Configuration/ResourceNameFormatter.cs
index 82a54ff010..a6e12951a9 100644
--- a/src/JsonApiDotNetCore/Configuration/ResourceNameFormatter.cs
+++ b/src/JsonApiDotNetCore/Configuration/ResourceNameFormatter.cs
@@ -19,7 +19,7 @@ public ResourceNameFormatter(JsonNamingPolicy? namingPolicy)
///
public string FormatResourceName(Type resourceClrType)
{
- ArgumentGuard.NotNull(resourceClrType, nameof(resourceClrType));
+ ArgumentGuard.NotNull(resourceClrType);
var resourceAttribute = resourceClrType.GetCustomAttribute(true);
diff --git a/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs b/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs
index 8b5356fdef..7ea42a2470 100644
--- a/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs
+++ b/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs
@@ -22,7 +22,7 @@ public static IServiceCollection AddJsonApi(this IServiceCollection services, Ac
ICollection? dbContextTypes = null)
#pragma warning restore AV1553 // Do not use optional parameters with default value null for strings, collections or tasks
{
- ArgumentGuard.NotNull(services, nameof(services));
+ ArgumentGuard.NotNull(services);
SetupApplicationBuilder(services, options, discovery, resources, mvcBuilder, dbContextTypes ?? Array.Empty());
@@ -59,7 +59,7 @@ private static void SetupApplicationBuilder(IServiceCollection services, Action<
///
public static IServiceCollection AddResourceService(this IServiceCollection services)
{
- ArgumentGuard.NotNull(services, nameof(services));
+ ArgumentGuard.NotNull(services);
RegisterTypeForUnboundInterfaces(services, typeof(TService), ServiceDiscoveryFacade.ServiceUnboundInterfaces);
@@ -72,7 +72,7 @@ public static IServiceCollection AddResourceService(this IServiceColle
///
public static IServiceCollection AddResourceRepository(this IServiceCollection services)
{
- ArgumentGuard.NotNull(services, nameof(services));
+ ArgumentGuard.NotNull(services);
RegisterTypeForUnboundInterfaces(services, typeof(TRepository), ServiceDiscoveryFacade.RepositoryUnboundInterfaces);
@@ -85,7 +85,7 @@ public static IServiceCollection AddResourceRepository(this IServic
///
public static IServiceCollection AddResourceDefinition(this IServiceCollection services)
{
- ArgumentGuard.NotNull(services, nameof(services));
+ ArgumentGuard.NotNull(services);
RegisterTypeForUnboundInterfaces(services, typeof(TResourceDefinition), ServiceDiscoveryFacade.ResourceDefinitionUnboundInterfaces);
diff --git a/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs b/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs
index 7498391afd..85f95c232f 100644
--- a/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs
+++ b/src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs
@@ -52,9 +52,9 @@ public sealed class ServiceDiscoveryFacade
public ServiceDiscoveryFacade(IServiceCollection services, ResourceGraphBuilder resourceGraphBuilder, ILoggerFactory loggerFactory)
{
- ArgumentGuard.NotNull(services, nameof(services));
- ArgumentGuard.NotNull(resourceGraphBuilder, nameof(resourceGraphBuilder));
- ArgumentGuard.NotNull(loggerFactory, nameof(loggerFactory));
+ ArgumentGuard.NotNull(services);
+ ArgumentGuard.NotNull(resourceGraphBuilder);
+ ArgumentGuard.NotNull(loggerFactory);
_logger = loggerFactory.CreateLogger();
_services = services;
@@ -74,7 +74,7 @@ public ServiceDiscoveryFacade AddCurrentAssembly()
///
public ServiceDiscoveryFacade AddAssembly(Assembly assembly)
{
- ArgumentGuard.NotNull(assembly, nameof(assembly));
+ ArgumentGuard.NotNull(assembly);
_assemblyCache.RegisterAssembly(assembly);
_logger.LogDebug($"Registering assembly '{assembly.FullName}' for discovery of resources and injectables.");
diff --git a/src/JsonApiDotNetCore/Configuration/TypeLocator.cs b/src/JsonApiDotNetCore/Configuration/TypeLocator.cs
index 2f004ffdf1..e4b1da8d01 100644
--- a/src/JsonApiDotNetCore/Configuration/TypeLocator.cs
+++ b/src/JsonApiDotNetCore/Configuration/TypeLocator.cs
@@ -66,9 +66,9 @@ internal sealed class TypeLocator
public (Type implementationType, Type serviceInterface)? GetContainerRegistrationFromAssembly(Assembly assembly, Type unboundInterface,
params Type[] interfaceTypeArguments)
{
- ArgumentGuard.NotNull(assembly, nameof(assembly));
- ArgumentGuard.NotNull(unboundInterface, nameof(unboundInterface));
- ArgumentGuard.NotNull(interfaceTypeArguments, nameof(interfaceTypeArguments));
+ ArgumentGuard.NotNull(assembly);
+ ArgumentGuard.NotNull(unboundInterface);
+ ArgumentGuard.NotNull(interfaceTypeArguments);
if (!unboundInterface.IsInterface || !unboundInterface.IsGenericType || unboundInterface != unboundInterface.GetGenericTypeDefinition())
{
@@ -129,9 +129,9 @@ private static (Type implementationType, Type serviceInterface)? GetContainerReg
///
public IReadOnlyCollection GetDerivedTypesForUnboundType(Assembly assembly, Type unboundType, params Type[] typeArguments)
{
- ArgumentGuard.NotNull(assembly, nameof(assembly));
- ArgumentGuard.NotNull(unboundType, nameof(unboundType));
- ArgumentGuard.NotNull(typeArguments, nameof(typeArguments));
+ ArgumentGuard.NotNull(assembly);
+ ArgumentGuard.NotNull(unboundType);
+ ArgumentGuard.NotNull(typeArguments);
Type closedType = unboundType.MakeGenericType(typeArguments);
return GetDerivedTypes(assembly, closedType).ToArray();
@@ -153,8 +153,8 @@ public IReadOnlyCollection GetDerivedTypesForUnboundType(Assembly assembly
///
public IEnumerable GetDerivedTypes(Assembly assembly, Type baseType)
{
- ArgumentGuard.NotNull(assembly, nameof(assembly));
- ArgumentGuard.NotNull(baseType, nameof(baseType));
+ ArgumentGuard.NotNull(assembly);
+ ArgumentGuard.NotNull(baseType);
foreach (Type type in assembly.GetTypes())
{
diff --git a/src/JsonApiDotNetCore/Controllers/Annotations/DisableQueryStringAttribute.cs b/src/JsonApiDotNetCore/Controllers/Annotations/DisableQueryStringAttribute.cs
index 975472ab28..eba4b8340c 100644
--- a/src/JsonApiDotNetCore/Controllers/Annotations/DisableQueryStringAttribute.cs
+++ b/src/JsonApiDotNetCore/Controllers/Annotations/DisableQueryStringAttribute.cs
@@ -46,7 +46,7 @@ public DisableQueryStringAttribute(JsonApiQueryStringParameters parameters)
///
public DisableQueryStringAttribute(string parameterNames)
{
- ArgumentGuard.NotNullNorEmpty(parameterNames, nameof(parameterNames));
+ ArgumentGuard.NotNullNorEmpty(parameterNames);
ParameterNames = parameterNames.Split(",").ToHashSet();
}
diff --git a/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs b/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs
index cabe4d49d8..22efab2840 100644
--- a/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs
+++ b/src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs
@@ -63,9 +63,9 @@ protected BaseJsonApiController(IJsonApiOptions options, IResourceGraph resource
IUpdateService? update = null, ISetRelationshipService? setRelationship = null,
IDeleteService? delete = null, IRemoveFromRelationshipService? removeFromRelationship = null)
{
- ArgumentGuard.NotNull(options, nameof(options));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
- ArgumentGuard.NotNull(loggerFactory, nameof(loggerFactory));
+ ArgumentGuard.NotNull(options);
+ ArgumentGuard.NotNull(resourceGraph);
+ ArgumentGuard.NotNull(loggerFactory);
_options = options;
_resourceGraph = resourceGraph;
@@ -139,7 +139,7 @@ public virtual async Task GetSecondaryAsync(TId id, string relati
relationshipName
});
- ArgumentGuard.NotNullNorEmpty(relationshipName, nameof(relationshipName));
+ ArgumentGuard.NotNullNorEmpty(relationshipName);
if (_getSecondary == null)
{
@@ -168,7 +168,7 @@ public virtual async Task GetRelationshipAsync(TId id, string rel
relationshipName
});
- ArgumentGuard.NotNullNorEmpty(relationshipName, nameof(relationshipName));
+ ArgumentGuard.NotNullNorEmpty(relationshipName);
if (_getRelationship == null)
{
@@ -192,7 +192,7 @@ public virtual async Task PostAsync([FromBody] TResource resource
resource
});
- ArgumentGuard.NotNull(resource, nameof(resource));
+ ArgumentGuard.NotNull(resource);
if (_create == null)
{
@@ -245,8 +245,8 @@ public virtual async Task PostRelationshipAsync(TId id, string re
rightResourceIds
});
- ArgumentGuard.NotNullNorEmpty(relationshipName, nameof(relationshipName));
- ArgumentGuard.NotNull(rightResourceIds, nameof(rightResourceIds));
+ ArgumentGuard.NotNullNorEmpty(relationshipName);
+ ArgumentGuard.NotNull(rightResourceIds);
if (_addToRelationship == null)
{
@@ -272,7 +272,7 @@ public virtual async Task PatchAsync(TId id, [FromBody] TResource
resource
});
- ArgumentGuard.NotNull(resource, nameof(resource));
+ ArgumentGuard.NotNull(resource);
if (_update == null)
{
@@ -320,7 +320,7 @@ public virtual async Task PatchRelationshipAsync(TId id, string r
rightValue
});
- ArgumentGuard.NotNullNorEmpty(relationshipName, nameof(relationshipName));
+ ArgumentGuard.NotNullNorEmpty(relationshipName);
if (_setRelationship == null)
{
@@ -381,8 +381,8 @@ public virtual async Task DeleteRelationshipAsync(TId id, string
rightResourceIds
});
- ArgumentGuard.NotNullNorEmpty(relationshipName, nameof(relationshipName));
- ArgumentGuard.NotNull(rightResourceIds, nameof(rightResourceIds));
+ ArgumentGuard.NotNullNorEmpty(relationshipName);
+ ArgumentGuard.NotNull(rightResourceIds);
if (_removeFromRelationship == null)
{
diff --git a/src/JsonApiDotNetCore/Controllers/BaseJsonApiOperationsController.cs b/src/JsonApiDotNetCore/Controllers/BaseJsonApiOperationsController.cs
index a948d67edc..2ea8f89a87 100644
--- a/src/JsonApiDotNetCore/Controllers/BaseJsonApiOperationsController.cs
+++ b/src/JsonApiDotNetCore/Controllers/BaseJsonApiOperationsController.cs
@@ -27,12 +27,12 @@ public abstract class BaseJsonApiOperationsController : CoreJsonApiController
protected BaseJsonApiOperationsController(IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory,
IOperationsProcessor processor, IJsonApiRequest request, ITargetedFields targetedFields)
{
- ArgumentGuard.NotNull(options, nameof(options));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
- ArgumentGuard.NotNull(loggerFactory, nameof(loggerFactory));
- ArgumentGuard.NotNull(processor, nameof(processor));
- ArgumentGuard.NotNull(request, nameof(request));
- ArgumentGuard.NotNull(targetedFields, nameof(targetedFields));
+ ArgumentGuard.NotNull(options);
+ ArgumentGuard.NotNull(resourceGraph);
+ ArgumentGuard.NotNull(loggerFactory);
+ ArgumentGuard.NotNull(processor);
+ ArgumentGuard.NotNull(request);
+ ArgumentGuard.NotNull(targetedFields);
_options = options;
_resourceGraph = resourceGraph;
@@ -109,7 +109,7 @@ public virtual async Task PostOperationsAsync([FromBody] IList errors)
{
IReadOnlyList? errorList = ToErrorList(errors);
- ArgumentGuard.NotNullNorEmpty(errorList, nameof(errors));
+ ArgumentGuard.NotNullNorEmpty(errorList);
return new ObjectResult(errorList)
{
diff --git a/src/JsonApiDotNetCore/Diagnostics/AspNetCodeTimerSession.cs b/src/JsonApiDotNetCore/Diagnostics/AspNetCodeTimerSession.cs
index bef29dba78..a42d734580 100644
--- a/src/JsonApiDotNetCore/Diagnostics/AspNetCodeTimerSession.cs
+++ b/src/JsonApiDotNetCore/Diagnostics/AspNetCodeTimerSession.cs
@@ -37,14 +37,14 @@ public ICodeTimer CodeTimer
public AspNetCodeTimerSession(IHttpContextAccessor httpContextAccessor)
{
- ArgumentGuard.NotNull(httpContextAccessor, nameof(httpContextAccessor));
+ ArgumentGuard.NotNull(httpContextAccessor);
_httpContextAccessor = httpContextAccessor;
}
public AspNetCodeTimerSession(HttpContext httpContext)
{
- ArgumentGuard.NotNull(httpContext, nameof(httpContext));
+ ArgumentGuard.NotNull(httpContext);
_httpContext = httpContext;
}
diff --git a/src/JsonApiDotNetCore/Diagnostics/CodeTimingSessionManager.cs b/src/JsonApiDotNetCore/Diagnostics/CodeTimingSessionManager.cs
index d858aa6f4b..5a862409bc 100644
--- a/src/JsonApiDotNetCore/Diagnostics/CodeTimingSessionManager.cs
+++ b/src/JsonApiDotNetCore/Diagnostics/CodeTimingSessionManager.cs
@@ -62,7 +62,7 @@ private static void AssertHasActiveSession()
public static void Capture(ICodeTimerSession session)
{
- ArgumentGuard.NotNull(session, nameof(session));
+ ArgumentGuard.NotNull(session);
AssertNoActiveSession();
diff --git a/src/JsonApiDotNetCore/Errors/InvalidModelStateException.cs b/src/JsonApiDotNetCore/Errors/InvalidModelStateException.cs
index eede4fed25..be4de87fc8 100644
--- a/src/JsonApiDotNetCore/Errors/InvalidModelStateException.cs
+++ b/src/JsonApiDotNetCore/Errors/InvalidModelStateException.cs
@@ -26,9 +26,9 @@ public InvalidModelStateException(IReadOnlyDictionary
private static IEnumerable FromModelStateDictionary(IReadOnlyDictionary modelState, Type modelType,
IResourceGraph resourceGraph, bool includeExceptionStackTraceInErrors, Func? getCollectionElementTypeCallback)
{
- ArgumentGuard.NotNull(modelState, nameof(modelState));
- ArgumentGuard.NotNull(modelType, nameof(modelType));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
+ ArgumentGuard.NotNull(modelState);
+ ArgumentGuard.NotNull(modelType);
+ ArgumentGuard.NotNull(resourceGraph);
List errorObjects = new();
@@ -229,8 +229,8 @@ private abstract class ModelStateKeySegment
protected ModelStateKeySegment(Type modelType, bool isInComplexType, string nextKey, string? sourcePointer, ModelStateKeySegment? parent,
Func? getCollectionElementTypeCallback)
{
- ArgumentGuard.NotNull(modelType, nameof(modelType));
- ArgumentGuard.NotNull(nextKey, nameof(nextKey));
+ ArgumentGuard.NotNull(modelType);
+ ArgumentGuard.NotNull(nextKey);
ModelType = modelType;
IsInComplexType = isInComplexType;
@@ -242,15 +242,15 @@ protected ModelStateKeySegment(Type modelType, bool isInComplexType, string next
public ModelStateKeySegment? GetNextSegment(Type modelType, bool isInComplexType, string? sourcePointer)
{
- ArgumentGuard.NotNull(modelType, nameof(modelType));
+ ArgumentGuard.NotNull(modelType);
return _nextKey == string.Empty ? null : CreateSegment(modelType, _nextKey, isInComplexType, this, sourcePointer, GetCollectionElementTypeCallback);
}
public static ModelStateKeySegment Create(Type modelType, string key, Func? getCollectionElementTypeCallback)
{
- ArgumentGuard.NotNull(modelType, nameof(modelType));
- ArgumentGuard.NotNull(key, nameof(key));
+ ArgumentGuard.NotNull(modelType);
+ ArgumentGuard.NotNull(key);
return CreateSegment(modelType, key, false, null, null, getCollectionElementTypeCallback);
}
@@ -359,14 +359,14 @@ public PropertySegment(string propertyName, Type modelType, bool isInComplexType
Func? getCollectionElementTypeCallback)
: base(modelType, isInComplexType, nextKey, sourcePointer, parent, getCollectionElementTypeCallback)
{
- ArgumentGuard.NotNull(propertyName, nameof(propertyName));
+ ArgumentGuard.NotNull(propertyName);
PropertyName = propertyName;
}
public static string GetPublicNameForProperty(PropertyInfo property)
{
- ArgumentGuard.NotNull(property, nameof(property));
+ ArgumentGuard.NotNull(property);
var jsonNameAttribute = property.GetCustomAttribute(true);
return jsonNameAttribute?.Name ?? property.Name;
diff --git a/src/JsonApiDotNetCore/Errors/JsonApiException.cs b/src/JsonApiDotNetCore/Errors/JsonApiException.cs
index 6bb62177dc..4571843e8d 100644
--- a/src/JsonApiDotNetCore/Errors/JsonApiException.cs
+++ b/src/JsonApiDotNetCore/Errors/JsonApiException.cs
@@ -24,7 +24,7 @@ public class JsonApiException : Exception
public JsonApiException(ErrorObject error, Exception? innerException = null)
: base(null, innerException)
{
- ArgumentGuard.NotNull(error, nameof(error));
+ ArgumentGuard.NotNull(error);
Errors = error.AsArray();
}
@@ -33,7 +33,7 @@ public JsonApiException(IEnumerable errors, Exception? innerExcepti
: base(null, innerException)
{
IReadOnlyList? errorList = ToErrorList(errors);
- ArgumentGuard.NotNullNorEmpty(errorList, nameof(errors));
+ ArgumentGuard.NotNullNorEmpty(errorList);
Errors = errorList;
}
diff --git a/src/JsonApiDotNetCore/Errors/MissingResourceInRelationship.cs b/src/JsonApiDotNetCore/Errors/MissingResourceInRelationship.cs
index e80181898d..42082d6126 100644
--- a/src/JsonApiDotNetCore/Errors/MissingResourceInRelationship.cs
+++ b/src/JsonApiDotNetCore/Errors/MissingResourceInRelationship.cs
@@ -11,9 +11,9 @@ public sealed class MissingResourceInRelationship
public MissingResourceInRelationship(string relationshipName, string resourceType, string resourceId)
{
- ArgumentGuard.NotNullNorEmpty(relationshipName, nameof(relationshipName));
- ArgumentGuard.NotNullNorEmpty(resourceType, nameof(resourceType));
- ArgumentGuard.NotNullNorEmpty(resourceId, nameof(resourceId));
+ ArgumentGuard.NotNullNorEmpty(relationshipName);
+ ArgumentGuard.NotNullNorEmpty(resourceType);
+ ArgumentGuard.NotNullNorEmpty(resourceId);
RelationshipName = relationshipName;
ResourceType = resourceType;
diff --git a/src/JsonApiDotNetCore/Errors/UnsuccessfulActionResultException.cs b/src/JsonApiDotNetCore/Errors/UnsuccessfulActionResultException.cs
index c5c55e4b70..e739ec9cbf 100644
--- a/src/JsonApiDotNetCore/Errors/UnsuccessfulActionResultException.cs
+++ b/src/JsonApiDotNetCore/Errors/UnsuccessfulActionResultException.cs
@@ -26,7 +26,7 @@ public UnsuccessfulActionResultException(ProblemDetails problemDetails)
private static ErrorObject ToError(ProblemDetails problemDetails)
{
- ArgumentGuard.NotNull(problemDetails, nameof(problemDetails));
+ ArgumentGuard.NotNull(problemDetails);
HttpStatusCode status = problemDetails.Status != null ? (HttpStatusCode)problemDetails.Status.Value : HttpStatusCode.InternalServerError;
diff --git a/src/JsonApiDotNetCore/Middleware/AsyncConvertEmptyActionResultFilter.cs b/src/JsonApiDotNetCore/Middleware/AsyncConvertEmptyActionResultFilter.cs
index cf51a82733..82e443a9af 100644
--- a/src/JsonApiDotNetCore/Middleware/AsyncConvertEmptyActionResultFilter.cs
+++ b/src/JsonApiDotNetCore/Middleware/AsyncConvertEmptyActionResultFilter.cs
@@ -10,8 +10,8 @@ public sealed class AsyncConvertEmptyActionResultFilter : IAsyncConvertEmptyActi
///
public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next)
{
- ArgumentGuard.NotNull(context, nameof(context));
- ArgumentGuard.NotNull(next, nameof(next));
+ ArgumentGuard.NotNull(context);
+ ArgumentGuard.NotNull(next);
if (context.HttpContext.IsJsonApiRequest())
{
diff --git a/src/JsonApiDotNetCore/Middleware/AsyncJsonApiExceptionFilter.cs b/src/JsonApiDotNetCore/Middleware/AsyncJsonApiExceptionFilter.cs
index e87fc98389..58d568a3ec 100644
--- a/src/JsonApiDotNetCore/Middleware/AsyncJsonApiExceptionFilter.cs
+++ b/src/JsonApiDotNetCore/Middleware/AsyncJsonApiExceptionFilter.cs
@@ -13,7 +13,7 @@ public sealed class AsyncJsonApiExceptionFilter : IAsyncJsonApiExceptionFilter
public AsyncJsonApiExceptionFilter(IExceptionHandler exceptionHandler)
{
- ArgumentGuard.NotNull(exceptionHandler, nameof(exceptionHandler));
+ ArgumentGuard.NotNull(exceptionHandler);
_exceptionHandler = exceptionHandler;
}
@@ -21,7 +21,7 @@ public AsyncJsonApiExceptionFilter(IExceptionHandler exceptionHandler)
///
public Task OnExceptionAsync(ExceptionContext context)
{
- ArgumentGuard.NotNull(context, nameof(context));
+ ArgumentGuard.NotNull(context);
if (context.HttpContext.IsJsonApiRequest())
{
diff --git a/src/JsonApiDotNetCore/Middleware/AsyncQueryStringActionFilter.cs b/src/JsonApiDotNetCore/Middleware/AsyncQueryStringActionFilter.cs
index 6f31c28d2a..89164c844f 100644
--- a/src/JsonApiDotNetCore/Middleware/AsyncQueryStringActionFilter.cs
+++ b/src/JsonApiDotNetCore/Middleware/AsyncQueryStringActionFilter.cs
@@ -12,7 +12,7 @@ public sealed class AsyncQueryStringActionFilter : IAsyncQueryStringActionFilter
public AsyncQueryStringActionFilter(IQueryStringReader queryStringReader)
{
- ArgumentGuard.NotNull(queryStringReader, nameof(queryStringReader));
+ ArgumentGuard.NotNull(queryStringReader);
_queryStringReader = queryStringReader;
}
@@ -20,8 +20,8 @@ public AsyncQueryStringActionFilter(IQueryStringReader queryStringReader)
///
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
- ArgumentGuard.NotNull(context, nameof(context));
- ArgumentGuard.NotNull(next, nameof(next));
+ ArgumentGuard.NotNull(context);
+ ArgumentGuard.NotNull(next);
if (context.HttpContext.IsJsonApiRequest())
{
diff --git a/src/JsonApiDotNetCore/Middleware/ExceptionHandler.cs b/src/JsonApiDotNetCore/Middleware/ExceptionHandler.cs
index ea1d67743d..b8690402a5 100644
--- a/src/JsonApiDotNetCore/Middleware/ExceptionHandler.cs
+++ b/src/JsonApiDotNetCore/Middleware/ExceptionHandler.cs
@@ -17,8 +17,8 @@ public class ExceptionHandler : IExceptionHandler
public ExceptionHandler(ILoggerFactory loggerFactory, IJsonApiOptions options)
{
- ArgumentGuard.NotNull(loggerFactory, nameof(loggerFactory));
- ArgumentGuard.NotNull(options, nameof(options));
+ ArgumentGuard.NotNull(loggerFactory);
+ ArgumentGuard.NotNull(options);
_options = options;
_logger = loggerFactory.CreateLogger();
@@ -26,7 +26,7 @@ public ExceptionHandler(ILoggerFactory loggerFactory, IJsonApiOptions options)
public IReadOnlyList HandleException(Exception exception)
{
- ArgumentGuard.NotNull(exception, nameof(exception));
+ ArgumentGuard.NotNull(exception);
Exception demystified = exception.Demystify();
@@ -45,7 +45,7 @@ private void LogException(Exception exception)
protected virtual LogLevel GetLogLevel(Exception exception)
{
- ArgumentGuard.NotNull(exception, nameof(exception));
+ ArgumentGuard.NotNull(exception);
if (exception is OperationCanceledException)
{
@@ -62,14 +62,14 @@ protected virtual LogLevel GetLogLevel(Exception exception)
protected virtual string GetLogMessage(Exception exception)
{
- ArgumentGuard.NotNull(exception, nameof(exception));
+ ArgumentGuard.NotNull(exception);
return exception is JsonApiException jsonApiException ? jsonApiException.GetSummary() : exception.Message;
}
protected virtual IReadOnlyList CreateErrorResponse(Exception exception)
{
- ArgumentGuard.NotNull(exception, nameof(exception));
+ ArgumentGuard.NotNull(exception);
IReadOnlyList errors = exception is JsonApiException jsonApiException ? jsonApiException.Errors :
exception is OperationCanceledException ? new ErrorObject((HttpStatusCode)499)
diff --git a/src/JsonApiDotNetCore/Middleware/HttpContextExtensions.cs b/src/JsonApiDotNetCore/Middleware/HttpContextExtensions.cs
index b6785e8198..a675aeeaff 100644
--- a/src/JsonApiDotNetCore/Middleware/HttpContextExtensions.cs
+++ b/src/JsonApiDotNetCore/Middleware/HttpContextExtensions.cs
@@ -13,7 +13,7 @@ public static class HttpContextExtensions
///
public static bool IsJsonApiRequest(this HttpContext httpContext)
{
- ArgumentGuard.NotNull(httpContext, nameof(httpContext));
+ ArgumentGuard.NotNull(httpContext);
string? value = httpContext.Items[IsJsonApiRequestKey] as string;
return value == bool.TrueString;
@@ -21,7 +21,7 @@ public static bool IsJsonApiRequest(this HttpContext httpContext)
internal static void RegisterJsonApiRequest(this HttpContext httpContext)
{
- ArgumentGuard.NotNull(httpContext, nameof(httpContext));
+ ArgumentGuard.NotNull(httpContext);
httpContext.Items[IsJsonApiRequestKey] = bool.TrueString;
}
diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiInputFormatter.cs b/src/JsonApiDotNetCore/Middleware/JsonApiInputFormatter.cs
index 077f0573f0..59563c9268 100644
--- a/src/JsonApiDotNetCore/Middleware/JsonApiInputFormatter.cs
+++ b/src/JsonApiDotNetCore/Middleware/JsonApiInputFormatter.cs
@@ -10,7 +10,7 @@ public sealed class JsonApiInputFormatter : IJsonApiInputFormatter
///
public bool CanRead(InputFormatterContext context)
{
- ArgumentGuard.NotNull(context, nameof(context));
+ ArgumentGuard.NotNull(context);
return context.HttpContext.IsJsonApiRequest();
}
@@ -18,7 +18,7 @@ public bool CanRead(InputFormatterContext context)
///
public async Task ReadAsync(InputFormatterContext context)
{
- ArgumentGuard.NotNull(context, nameof(context));
+ ArgumentGuard.NotNull(context);
var reader = context.HttpContext.RequestServices.GetRequiredService();
diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs b/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs
index 2e15e6ae9a..b38ad986dd 100644
--- a/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs
+++ b/src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs
@@ -36,11 +36,11 @@ public JsonApiMiddleware(RequestDelegate next, IHttpContextAccessor httpContextA
public async Task InvokeAsync(HttpContext httpContext, IControllerResourceMapping controllerResourceMapping, IJsonApiOptions options,
IJsonApiRequest request, ILogger logger)
{
- ArgumentGuard.NotNull(httpContext, nameof(httpContext));
- ArgumentGuard.NotNull(controllerResourceMapping, nameof(controllerResourceMapping));
- ArgumentGuard.NotNull(options, nameof(options));
- ArgumentGuard.NotNull(request, nameof(request));
- ArgumentGuard.NotNull(logger, nameof(logger));
+ ArgumentGuard.NotNull(httpContext);
+ ArgumentGuard.NotNull(controllerResourceMapping);
+ ArgumentGuard.NotNull(options);
+ ArgumentGuard.NotNull(request);
+ ArgumentGuard.NotNull(logger);
using (CodeTimingSessionManager.Current.Measure("JSON:API middleware"))
{
diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiOutputFormatter.cs b/src/JsonApiDotNetCore/Middleware/JsonApiOutputFormatter.cs
index c32bb9d9f9..8c97a12ea4 100644
--- a/src/JsonApiDotNetCore/Middleware/JsonApiOutputFormatter.cs
+++ b/src/JsonApiDotNetCore/Middleware/JsonApiOutputFormatter.cs
@@ -10,7 +10,7 @@ public sealed class JsonApiOutputFormatter : IJsonApiOutputFormatter
///
public bool CanWriteResult(OutputFormatterCanWriteContext context)
{
- ArgumentGuard.NotNull(context, nameof(context));
+ ArgumentGuard.NotNull(context);
return context.HttpContext.IsJsonApiRequest();
}
@@ -18,7 +18,7 @@ public bool CanWriteResult(OutputFormatterCanWriteContext context)
///
public async Task WriteAsync(OutputFormatterWriteContext context)
{
- ArgumentGuard.NotNull(context, nameof(context));
+ ArgumentGuard.NotNull(context);
var writer = context.HttpContext.RequestServices.GetRequiredService();
await writer.WriteAsync(context.Object, context.HttpContext);
diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiRequest.cs b/src/JsonApiDotNetCore/Middleware/JsonApiRequest.cs
index a28c01fcd6..98e42823a3 100644
--- a/src/JsonApiDotNetCore/Middleware/JsonApiRequest.cs
+++ b/src/JsonApiDotNetCore/Middleware/JsonApiRequest.cs
@@ -38,7 +38,7 @@ public sealed class JsonApiRequest : IJsonApiRequest
///
public void CopyFrom(IJsonApiRequest other)
{
- ArgumentGuard.NotNull(other, nameof(other));
+ ArgumentGuard.NotNull(other);
Kind = other.Kind;
PrimaryId = other.PrimaryId;
diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs
index fe95d93446..a05aa979ef 100644
--- a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs
+++ b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs
@@ -36,8 +36,8 @@ public sealed class JsonApiRoutingConvention : IJsonApiRoutingConvention
public JsonApiRoutingConvention(IJsonApiOptions options, IResourceGraph resourceGraph)
{
- ArgumentGuard.NotNull(options, nameof(options));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
+ ArgumentGuard.NotNull(options);
+ ArgumentGuard.NotNull(resourceGraph);
_options = options;
_resourceGraph = resourceGraph;
@@ -60,7 +60,7 @@ public JsonApiRoutingConvention(IJsonApiOptions options, IResourceGraph resource
///
public void Apply(ApplicationModel application)
{
- ArgumentGuard.NotNull(application, nameof(application));
+ ArgumentGuard.NotNull(application);
foreach (ControllerModel controller in application.Controllers)
{
diff --git a/src/JsonApiDotNetCore/Queries/ExpressionInScope.cs b/src/JsonApiDotNetCore/Queries/ExpressionInScope.cs
index 37d40f127b..6ac6f75059 100644
--- a/src/JsonApiDotNetCore/Queries/ExpressionInScope.cs
+++ b/src/JsonApiDotNetCore/Queries/ExpressionInScope.cs
@@ -15,7 +15,7 @@ public class ExpressionInScope
public ExpressionInScope(ResourceFieldChainExpression? scope, QueryExpression expression)
{
- ArgumentGuard.NotNull(expression, nameof(expression));
+ ArgumentGuard.NotNull(expression);
Scope = scope;
Expression = expression;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/AnyExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/AnyExpression.cs
index 980a7846bc..2b855b1bdb 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/AnyExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/AnyExpression.cs
@@ -16,8 +16,8 @@ public class AnyExpression : FilterExpression
public AnyExpression(ResourceFieldChainExpression targetAttribute, IImmutableSet constants)
{
- ArgumentGuard.NotNull(targetAttribute, nameof(targetAttribute));
- ArgumentGuard.NotNull(constants, nameof(constants));
+ ArgumentGuard.NotNull(targetAttribute);
+ ArgumentGuard.NotNull(constants);
if (constants.Count < 2)
{
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/ComparisonExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/ComparisonExpression.cs
index 9bf1c3bde8..cdae713f3d 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/ComparisonExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/ComparisonExpression.cs
@@ -15,8 +15,8 @@ public class ComparisonExpression : FilterExpression
public ComparisonExpression(ComparisonOperator @operator, QueryExpression left, QueryExpression right)
{
- ArgumentGuard.NotNull(left, nameof(left));
- ArgumentGuard.NotNull(right, nameof(right));
+ ArgumentGuard.NotNull(left);
+ ArgumentGuard.NotNull(right);
Operator = @operator;
Left = left;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/CountExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/CountExpression.cs
index 5de89ead7c..2eff0a86e9 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/CountExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/CountExpression.cs
@@ -13,7 +13,7 @@ public class CountExpression : FunctionExpression
public CountExpression(ResourceFieldChainExpression targetCollection)
{
- ArgumentGuard.NotNull(targetCollection, nameof(targetCollection));
+ ArgumentGuard.NotNull(targetCollection);
TargetCollection = targetCollection;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/HasExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/HasExpression.cs
index c5387106d6..825119fe33 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/HasExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/HasExpression.cs
@@ -15,7 +15,7 @@ public class HasExpression : FilterExpression
public HasExpression(ResourceFieldChainExpression targetCollection, FilterExpression? filter)
{
- ArgumentGuard.NotNull(targetCollection, nameof(targetCollection));
+ ArgumentGuard.NotNull(targetCollection);
TargetCollection = targetCollection;
Filter = filter;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/IncludeChainConverter.cs b/src/JsonApiDotNetCore/Queries/Expressions/IncludeChainConverter.cs
index b35c48efbd..8b2034a374 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/IncludeChainConverter.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/IncludeChainConverter.cs
@@ -29,7 +29,7 @@ internal sealed class IncludeChainConverter
///
public IReadOnlyCollection GetRelationshipChains(IncludeExpression include)
{
- ArgumentGuard.NotNull(include, nameof(include));
+ ArgumentGuard.NotNull(include);
if (!include.Elements.Any())
{
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/IncludeElementExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/IncludeElementExpression.cs
index e76aaf0946..01c25dad4e 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/IncludeElementExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/IncludeElementExpression.cs
@@ -21,8 +21,8 @@ public IncludeElementExpression(RelationshipAttribute relationship)
public IncludeElementExpression(RelationshipAttribute relationship, IImmutableSet children)
{
- ArgumentGuard.NotNull(relationship, nameof(relationship));
- ArgumentGuard.NotNull(children, nameof(children));
+ ArgumentGuard.NotNull(relationship);
+ ArgumentGuard.NotNull(children);
Relationship = relationship;
Children = children;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/IncludeExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/IncludeExpression.cs
index a63d87719d..69373c9abf 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/IncludeExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/IncludeExpression.cs
@@ -17,7 +17,7 @@ public class IncludeExpression : QueryExpression
public IncludeExpression(IImmutableSet elements)
{
- ArgumentGuard.NotNullNorEmpty(elements, nameof(elements));
+ ArgumentGuard.NotNullNorEmpty(elements);
Elements = elements;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/IsTypeExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/IsTypeExpression.cs
index a30e31308b..4e259b358e 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/IsTypeExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/IsTypeExpression.cs
@@ -18,7 +18,7 @@ public class IsTypeExpression : FilterExpression
public IsTypeExpression(ResourceFieldChainExpression? targetToOneRelationship, ResourceType derivedType, FilterExpression? child)
{
- ArgumentGuard.NotNull(derivedType, nameof(derivedType));
+ ArgumentGuard.NotNull(derivedType);
TargetToOneRelationship = targetToOneRelationship;
DerivedType = derivedType;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/LiteralConstantExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/LiteralConstantExpression.cs
index 17c62f230f..578643d5db 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/LiteralConstantExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/LiteralConstantExpression.cs
@@ -12,7 +12,7 @@ public class LiteralConstantExpression : IdentifierExpression
public LiteralConstantExpression(string text)
{
- ArgumentGuard.NotNull(text, nameof(text));
+ ArgumentGuard.NotNull(text);
Value = text;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/LogicalExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/LogicalExpression.cs
index c8d8ffb24b..08f970aee5 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/LogicalExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/LogicalExpression.cs
@@ -21,7 +21,7 @@ public LogicalExpression(LogicalOperator @operator, params FilterExpression[] te
public LogicalExpression(LogicalOperator @operator, IImmutableList terms)
{
- ArgumentGuard.NotNull(terms, nameof(terms));
+ ArgumentGuard.NotNull(terms);
if (terms.Count < 2)
{
@@ -34,7 +34,7 @@ public LogicalExpression(LogicalOperator @operator, IImmutableList terms = filters.WhereNotNull().ToImmutableArray();
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/MatchTextExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/MatchTextExpression.cs
index a9c598402b..5d9ed08859 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/MatchTextExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/MatchTextExpression.cs
@@ -16,8 +16,8 @@ public class MatchTextExpression : FilterExpression
public MatchTextExpression(ResourceFieldChainExpression targetAttribute, LiteralConstantExpression textValue, TextMatchKind matchKind)
{
- ArgumentGuard.NotNull(targetAttribute, nameof(targetAttribute));
- ArgumentGuard.NotNull(textValue, nameof(textValue));
+ ArgumentGuard.NotNull(targetAttribute);
+ ArgumentGuard.NotNull(textValue);
TargetAttribute = targetAttribute;
TextValue = textValue;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/NotExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/NotExpression.cs
index 4d28c4a9c3..ae198cd3ee 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/NotExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/NotExpression.cs
@@ -13,7 +13,7 @@ public class NotExpression : FilterExpression
public NotExpression(FilterExpression child)
{
- ArgumentGuard.NotNull(child, nameof(child));
+ ArgumentGuard.NotNull(child);
Child = child;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/PaginationExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/PaginationExpression.cs
index 97ff8b1456..2ecd9901a2 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/PaginationExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/PaginationExpression.cs
@@ -14,7 +14,7 @@ public class PaginationExpression : QueryExpression
public PaginationExpression(PageNumber pageNumber, PageSize? pageSize)
{
- ArgumentGuard.NotNull(pageNumber, nameof(pageNumber));
+ ArgumentGuard.NotNull(pageNumber);
PageNumber = pageNumber;
PageSize = pageSize;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/PaginationQueryStringValueExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/PaginationQueryStringValueExpression.cs
index 594dab297a..a65e9c0a15 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/PaginationQueryStringValueExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/PaginationQueryStringValueExpression.cs
@@ -13,7 +13,7 @@ public class PaginationQueryStringValueExpression : QueryExpression
public PaginationQueryStringValueExpression(IImmutableList elements)
{
- ArgumentGuard.NotNullNorEmpty(elements, nameof(elements));
+ ArgumentGuard.NotNullNorEmpty(elements);
Elements = elements;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/QueryStringParameterScopeExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/QueryStringParameterScopeExpression.cs
index e567da8778..bc2d018033 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/QueryStringParameterScopeExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/QueryStringParameterScopeExpression.cs
@@ -13,7 +13,7 @@ public class QueryStringParameterScopeExpression : QueryExpression
public QueryStringParameterScopeExpression(LiteralConstantExpression parameterName, ResourceFieldChainExpression? scope)
{
- ArgumentGuard.NotNull(parameterName, nameof(parameterName));
+ ArgumentGuard.NotNull(parameterName);
ParameterName = parameterName;
Scope = scope;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs
index 1d9c910955..872cdb1aac 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs
@@ -15,7 +15,7 @@ public class QueryableHandlerExpression : QueryExpression
public QueryableHandlerExpression(object queryableHandler, StringValues parameterValue)
{
- ArgumentGuard.NotNull(queryableHandler, nameof(queryableHandler));
+ ArgumentGuard.NotNull(queryableHandler);
_queryableHandler = queryableHandler;
_parameterValue = parameterValue;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/ResourceFieldChainExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/ResourceFieldChainExpression.cs
index 7decec6221..9224642133 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/ResourceFieldChainExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/ResourceFieldChainExpression.cs
@@ -14,14 +14,14 @@ public class ResourceFieldChainExpression : IdentifierExpression
public ResourceFieldChainExpression(ResourceFieldAttribute field)
{
- ArgumentGuard.NotNull(field, nameof(field));
+ ArgumentGuard.NotNull(field);
Fields = ImmutableArray.Create(field);
}
public ResourceFieldChainExpression(IImmutableList fields)
{
- ArgumentGuard.NotNullNorEmpty(fields, nameof(fields));
+ ArgumentGuard.NotNullNorEmpty(fields);
Fields = fields;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/SortElementExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/SortElementExpression.cs
index 78de440a42..bfdf30e8d5 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/SortElementExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/SortElementExpression.cs
@@ -15,7 +15,7 @@ public class SortElementExpression : QueryExpression
public SortElementExpression(ResourceFieldChainExpression targetAttribute, bool isAscending)
{
- ArgumentGuard.NotNull(targetAttribute, nameof(targetAttribute));
+ ArgumentGuard.NotNull(targetAttribute);
TargetAttribute = targetAttribute;
IsAscending = isAscending;
@@ -23,7 +23,7 @@ public SortElementExpression(ResourceFieldChainExpression targetAttribute, bool
public SortElementExpression(CountExpression count, bool isAscending)
{
- ArgumentGuard.NotNull(count, nameof(count));
+ ArgumentGuard.NotNull(count);
Count = count;
IsAscending = isAscending;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs
index dc0aebd320..53b067d4e8 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/SortExpression.cs
@@ -13,7 +13,7 @@ public class SortExpression : QueryExpression
public SortExpression(IImmutableList elements)
{
- ArgumentGuard.NotNullNorEmpty(elements, nameof(elements));
+ ArgumentGuard.NotNullNorEmpty(elements);
Elements = elements;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpression.cs
index bc1e611bd8..f36427b2e1 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpression.cs
@@ -14,7 +14,7 @@ public class SparseFieldSetExpression : QueryExpression
public SparseFieldSetExpression(IImmutableSet fields)
{
- ArgumentGuard.NotNullNorEmpty(fields, nameof(fields));
+ ArgumentGuard.NotNullNorEmpty(fields);
Fields = fields;
}
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpressionExtensions.cs b/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpressionExtensions.cs
index 53f9ff0eb6..c7c331eb46 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpressionExtensions.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldSetExpressionExtensions.cs
@@ -14,8 +14,8 @@ public static class SparseFieldSetExpressionExtensions
Expression> fieldSelector, IResourceGraph resourceGraph)
where TResource : class, IIdentifiable
{
- ArgumentGuard.NotNull(fieldSelector, nameof(fieldSelector));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
+ ArgumentGuard.NotNull(fieldSelector);
+ ArgumentGuard.NotNull(resourceGraph);
SparseFieldSetExpression? newSparseFieldSet = sparseFieldSet;
@@ -42,8 +42,8 @@ public static class SparseFieldSetExpressionExtensions
Expression> fieldSelector, IResourceGraph resourceGraph)
where TResource : class, IIdentifiable
{
- ArgumentGuard.NotNull(fieldSelector, nameof(fieldSelector));
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
+ ArgumentGuard.NotNull(fieldSelector);
+ ArgumentGuard.NotNull(resourceGraph);
SparseFieldSetExpression? newSparseFieldSet = sparseFieldSet;
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldTableExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldTableExpression.cs
index 8e52df9b3b..c69be71292 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldTableExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/SparseFieldTableExpression.cs
@@ -15,7 +15,7 @@ public class SparseFieldTableExpression : QueryExpression
public SparseFieldTableExpression(IImmutableDictionary table)
{
- ArgumentGuard.NotNullNorEmpty(table, nameof(table), "entries");
+ ArgumentGuard.NotNullNorEmpty(table);
Table = table;
}
diff --git a/src/JsonApiDotNetCore/Queries/FieldSelection.cs b/src/JsonApiDotNetCore/Queries/FieldSelection.cs
index 54c59005bf..7f62db1fcf 100644
--- a/src/JsonApiDotNetCore/Queries/FieldSelection.cs
+++ b/src/JsonApiDotNetCore/Queries/FieldSelection.cs
@@ -23,7 +23,7 @@ public IReadOnlySet GetResourceTypes()
public FieldSelectors GetOrCreateSelectors(ResourceType resourceType)
#pragma warning restore AV1130 // Return type in method signature should be an interface to an unchangeable collection
{
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNull(resourceType);
if (!ContainsKey(resourceType))
{
diff --git a/src/JsonApiDotNetCore/Queries/FieldSelectors.cs b/src/JsonApiDotNetCore/Queries/FieldSelectors.cs
index a07b4f0c79..ffd95c01bc 100644
--- a/src/JsonApiDotNetCore/Queries/FieldSelectors.cs
+++ b/src/JsonApiDotNetCore/Queries/FieldSelectors.cs
@@ -30,21 +30,21 @@ public bool ContainsOnlyRelationships
public bool ContainsField(ResourceFieldAttribute field)
{
- ArgumentGuard.NotNull(field, nameof(field));
+ ArgumentGuard.NotNull(field);
return ContainsKey(field);
}
public void IncludeAttribute(AttrAttribute attribute)
{
- ArgumentGuard.NotNull(attribute, nameof(attribute));
+ ArgumentGuard.NotNull(attribute);
this[attribute] = null;
}
public void IncludeAttributes(IEnumerable attributes)
{
- ArgumentGuard.NotNull(attributes, nameof(attributes));
+ ArgumentGuard.NotNull(attributes);
foreach (AttrAttribute attribute in attributes)
{
@@ -54,7 +54,7 @@ public void IncludeAttributes(IEnumerable attributes)
public void IncludeRelationship(RelationshipAttribute relationship, QueryLayer? queryLayer)
{
- ArgumentGuard.NotNull(relationship, nameof(relationship));
+ ArgumentGuard.NotNull(relationship);
this[relationship] = queryLayer;
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/EvaluatedIncludeCache.cs b/src/JsonApiDotNetCore/Queries/Internal/EvaluatedIncludeCache.cs
index 509baf73ee..bbd383fa28 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/EvaluatedIncludeCache.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/EvaluatedIncludeCache.cs
@@ -10,7 +10,7 @@ internal sealed class EvaluatedIncludeCache : IEvaluatedIncludeCache
///
public void Set(IncludeExpression include)
{
- ArgumentGuard.NotNull(include, nameof(include));
+ ArgumentGuard.NotNull(include);
_include = include;
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/FilterParser.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/FilterParser.cs
index 705f057bc5..c68e0f77f7 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/FilterParser.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/FilterParser.cs
@@ -18,7 +18,7 @@ public class FilterParser : QueryExpressionParser
public FilterParser(IResourceFactory resourceFactory, Action? validateSingleFieldCallback = null)
{
- ArgumentGuard.NotNull(resourceFactory, nameof(resourceFactory));
+ ArgumentGuard.NotNull(resourceFactory);
_resourceFactory = resourceFactory;
_validateSingleFieldCallback = validateSingleFieldCallback;
@@ -26,7 +26,7 @@ public FilterParser(IResourceFactory resourceFactory, Action
{
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/IncludeParser.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/IncludeParser.cs
index 14d2f1ec15..7418be160f 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/IncludeParser.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/IncludeParser.cs
@@ -15,7 +15,7 @@ public class IncludeParser : QueryExpressionParser
public IncludeExpression Parse(string source, ResourceType resourceTypeInScope, int? maximumDepth)
{
- ArgumentGuard.NotNull(resourceTypeInScope, nameof(resourceTypeInScope));
+ ArgumentGuard.NotNull(resourceTypeInScope);
Tokenize(source);
@@ -266,7 +266,7 @@ private sealed class HiddenRootRelationshipAttribute : RelationshipAttribute
{
public HiddenRootRelationshipAttribute(ResourceType rightType)
{
- ArgumentGuard.NotNull(rightType, nameof(rightType));
+ ArgumentGuard.NotNull(rightType);
RightType = rightType;
PublicName = "<>";
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/PaginationParser.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/PaginationParser.cs
index 29c7713b11..50b542de6e 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/PaginationParser.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/PaginationParser.cs
@@ -19,7 +19,7 @@ public PaginationParser(Action? va
public PaginationQueryStringValueExpression Parse(string source, ResourceType resourceTypeInScope)
{
- ArgumentGuard.NotNull(resourceTypeInScope, nameof(resourceTypeInScope));
+ ArgumentGuard.NotNull(resourceTypeInScope);
_resourceTypeInScope = resourceTypeInScope;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryStringParameterScopeParser.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryStringParameterScopeParser.cs
index 3cba8e4515..ef95b3ed92 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryStringParameterScopeParser.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryStringParameterScopeParser.cs
@@ -22,7 +22,7 @@ public QueryStringParameterScopeParser(FieldChainRequirements chainRequirements,
public QueryStringParameterScopeExpression Parse(string source, ResourceType resourceTypeInScope)
{
- ArgumentGuard.NotNull(resourceTypeInScope, nameof(resourceTypeInScope));
+ ArgumentGuard.NotNull(resourceTypeInScope);
_resourceTypeInScope = resourceTypeInScope;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryTokenizer.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryTokenizer.cs
index 3f04ce92aa..cd920554c9 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryTokenizer.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/QueryTokenizer.cs
@@ -27,7 +27,7 @@ public sealed class QueryTokenizer
public QueryTokenizer(string source)
{
- ArgumentGuard.NotNull(source, nameof(source));
+ ArgumentGuard.NotNull(source);
_source = source;
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/SortParser.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/SortParser.cs
index 84782c2b3e..7f4a142ef0 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/SortParser.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/SortParser.cs
@@ -19,7 +19,7 @@ public SortParser(Action? validate
public SortExpression Parse(string source, ResourceType resourceTypeInScope)
{
- ArgumentGuard.NotNull(resourceTypeInScope, nameof(resourceTypeInScope));
+ ArgumentGuard.NotNull(resourceTypeInScope);
_resourceTypeInScope = resourceTypeInScope;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldSetParser.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldSetParser.cs
index b4e54f0c46..0cabbcf76e 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldSetParser.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldSetParser.cs
@@ -19,7 +19,7 @@ public SparseFieldSetParser(Action
public SparseFieldSetExpression? Parse(string source, ResourceType resourceType)
{
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNull(resourceType);
_resourceType = resourceType;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldTypeParser.cs b/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldTypeParser.cs
index b23dfdfea1..eceb05d211 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldTypeParser.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/Parsing/SparseFieldTypeParser.cs
@@ -12,7 +12,7 @@ public class SparseFieldTypeParser : QueryExpressionParser
public SparseFieldTypeParser(IResourceGraph resourceGraph)
{
- ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
+ ArgumentGuard.NotNull(resourceGraph);
_resourceGraph = resourceGraph;
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryLayerComposer.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryLayerComposer.cs
index 40af882044..29e0935954 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryLayerComposer.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryLayerComposer.cs
@@ -25,13 +25,13 @@ public QueryLayerComposer(IEnumerable constraintProvid
IJsonApiOptions options, IPaginationContext paginationContext, ITargetedFields targetedFields, IEvaluatedIncludeCache evaluatedIncludeCache,
ISparseFieldSetCache sparseFieldSetCache)
{
- ArgumentGuard.NotNull(constraintProviders, nameof(constraintProviders));
- ArgumentGuard.NotNull(resourceDefinitionAccessor, nameof(resourceDefinitionAccessor));
- ArgumentGuard.NotNull(options, nameof(options));
- ArgumentGuard.NotNull(paginationContext, nameof(paginationContext));
- ArgumentGuard.NotNull(targetedFields, nameof(targetedFields));
- ArgumentGuard.NotNull(evaluatedIncludeCache, nameof(evaluatedIncludeCache));
- ArgumentGuard.NotNull(sparseFieldSetCache, nameof(sparseFieldSetCache));
+ ArgumentGuard.NotNull(constraintProviders);
+ ArgumentGuard.NotNull(resourceDefinitionAccessor);
+ ArgumentGuard.NotNull(options);
+ ArgumentGuard.NotNull(paginationContext);
+ ArgumentGuard.NotNull(targetedFields);
+ ArgumentGuard.NotNull(evaluatedIncludeCache);
+ ArgumentGuard.NotNull(sparseFieldSetCache);
_constraintProviders = constraintProviders;
_resourceDefinitionAccessor = resourceDefinitionAccessor;
@@ -65,7 +65,7 @@ public QueryLayerComposer(IEnumerable constraintProvid
///
public FilterExpression? GetSecondaryFilterFromConstraints(TId primaryId, HasManyAttribute hasManyRelationship)
{
- ArgumentGuard.NotNull(hasManyRelationship, nameof(hasManyRelationship));
+ ArgumentGuard.NotNull(hasManyRelationship);
if (hasManyRelationship.InverseNavigationProperty == null)
{
@@ -131,7 +131,7 @@ private static FilterExpression GetInverseHasManyRelationshipFilter(TId pri
///
public QueryLayer ComposeFromConstraints(ResourceType requestResourceType)
{
- ArgumentGuard.NotNull(requestResourceType, nameof(requestResourceType));
+ ArgumentGuard.NotNull(requestResourceType);
ExpressionInScope[] constraints = _constraintProviders.SelectMany(provider => provider.GetConstraints()).ToArray();
@@ -268,7 +268,7 @@ private static IImmutableSet ApplyIncludeElementUpdate
///
public QueryLayer ComposeForGetById(TId id, ResourceType primaryResourceType, TopFieldSelection fieldSelection)
{
- ArgumentGuard.NotNull(primaryResourceType, nameof(primaryResourceType));
+ ArgumentGuard.NotNull(primaryResourceType);
AttrAttribute idAttribute = GetIdAttribute(primaryResourceType);
@@ -296,7 +296,7 @@ public QueryLayer ComposeForGetById(TId id, ResourceType primaryResourceTyp
///
public QueryLayer ComposeSecondaryLayerForRelationship(ResourceType secondaryResourceType)
{
- ArgumentGuard.NotNull(secondaryResourceType, nameof(secondaryResourceType));
+ ArgumentGuard.NotNull(secondaryResourceType);
QueryLayer secondaryLayer = ComposeFromConstraints(secondaryResourceType);
secondaryLayer.Selection = GetSelectionForRelationship(secondaryResourceType);
@@ -320,9 +320,9 @@ private FieldSelection GetSelectionForRelationship(ResourceType secondaryResourc
public QueryLayer WrapLayerForSecondaryEndpoint(QueryLayer secondaryLayer, ResourceType primaryResourceType, TId primaryId,
RelationshipAttribute relationship)
{
- ArgumentGuard.NotNull(secondaryLayer, nameof(secondaryLayer));
- ArgumentGuard.NotNull(primaryResourceType, nameof(primaryResourceType));
- ArgumentGuard.NotNull(relationship, nameof(relationship));
+ ArgumentGuard.NotNull(secondaryLayer);
+ ArgumentGuard.NotNull(primaryResourceType);
+ ArgumentGuard.NotNull(relationship);
IncludeExpression? innerInclude = secondaryLayer.Include;
secondaryLayer.Include = null;
@@ -377,7 +377,7 @@ private IncludeExpression RewriteIncludeForSecondaryEndpoint(IncludeExpression?
///
public QueryLayer ComposeForUpdate(TId id, ResourceType primaryResourceType)
{
- ArgumentGuard.NotNull(primaryResourceType, nameof(primaryResourceType));
+ ArgumentGuard.NotNull(primaryResourceType);
IImmutableSet includeElements = _targetedFields.Relationships
.Select(relationship => new IncludeElementExpression(relationship)).ToImmutableHashSet();
@@ -397,7 +397,7 @@ public QueryLayer ComposeForUpdate(TId id, ResourceType primaryResourceType
///
public IEnumerable<(QueryLayer, RelationshipAttribute)> ComposeForGetTargetedSecondaryResourceIds(IIdentifiable primaryResource)
{
- ArgumentGuard.NotNull(primaryResource, nameof(primaryResource));
+ ArgumentGuard.NotNull(primaryResource);
foreach (RelationshipAttribute relationship in _targetedFields.Relationships)
{
@@ -415,8 +415,8 @@ public QueryLayer ComposeForUpdate(TId id, ResourceType primaryResourceType
///
public QueryLayer ComposeForGetRelationshipRightIds(RelationshipAttribute relationship, ICollection rightResourceIds)
{
- ArgumentGuard.NotNull(relationship, nameof(relationship));
- ArgumentGuard.NotNull(rightResourceIds, nameof(rightResourceIds));
+ ArgumentGuard.NotNull(relationship);
+ ArgumentGuard.NotNull(rightResourceIds);
AttrAttribute rightIdAttribute = GetIdAttribute(relationship.RightType);
@@ -440,8 +440,8 @@ public QueryLayer ComposeForGetRelationshipRightIds(RelationshipAttribute relati
///
public QueryLayer ComposeForHasMany(HasManyAttribute hasManyRelationship, TId leftId, ICollection rightResourceIds)
{
- ArgumentGuard.NotNull(hasManyRelationship, nameof(hasManyRelationship));
- ArgumentGuard.NotNull(rightResourceIds, nameof(rightResourceIds));
+ ArgumentGuard.NotNull(hasManyRelationship);
+ ArgumentGuard.NotNull(rightResourceIds);
AttrAttribute leftIdAttribute = GetIdAttribute(hasManyRelationship.LeftType);
AttrAttribute rightIdAttribute = GetIdAttribute(hasManyRelationship.RightType);
@@ -476,15 +476,15 @@ public QueryLayer ComposeForHasMany(HasManyAttribute hasManyRelationship, T
protected virtual IImmutableSet GetIncludeElements(IImmutableSet includeElements,
ResourceType resourceType)
{
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNull(resourceType);
return _resourceDefinitionAccessor.OnApplyIncludes(resourceType, includeElements);
}
protected virtual FilterExpression? GetFilter(IReadOnlyCollection expressionsInScope, ResourceType resourceType)
{
- ArgumentGuard.NotNull(expressionsInScope, nameof(expressionsInScope));
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNull(expressionsInScope);
+ ArgumentGuard.NotNull(resourceType);
FilterExpression[] filters = expressionsInScope.OfType().ToArray();
FilterExpression? filter = LogicalExpression.Compose(LogicalOperator.And, filters);
@@ -494,8 +494,8 @@ protected virtual IImmutableSet GetIncludeElements(IIm
protected virtual SortExpression GetSort(IReadOnlyCollection expressionsInScope, ResourceType resourceType)
{
- ArgumentGuard.NotNull(expressionsInScope, nameof(expressionsInScope));
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNull(expressionsInScope);
+ ArgumentGuard.NotNull(resourceType);
SortExpression? sort = expressionsInScope.OfType().FirstOrDefault();
@@ -513,8 +513,8 @@ protected virtual SortExpression GetSort(IReadOnlyCollection ex
protected virtual PaginationExpression GetPagination(IReadOnlyCollection expressionsInScope, ResourceType resourceType)
{
- ArgumentGuard.NotNull(expressionsInScope, nameof(expressionsInScope));
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNull(expressionsInScope);
+ ArgumentGuard.NotNull(resourceType);
PaginationExpression? pagination = expressionsInScope.OfType().FirstOrDefault();
@@ -529,7 +529,7 @@ protected virtual PaginationExpression GetPagination(IReadOnlyCollection
public IncludeClauseBuilder(Expression source, LambdaScope lambdaScope, ResourceType resourceType)
: base(lambdaScope)
{
- ArgumentGuard.NotNull(source, nameof(source));
- ArgumentGuard.NotNull(resourceType, nameof(resourceType));
+ ArgumentGuard.NotNull(source);
+ ArgumentGuard.NotNull(resourceType);
_source = source;
_resourceType = resourceType;
@@ -30,7 +30,7 @@ public IncludeClauseBuilder(Expression source, LambdaScope lambdaScope, Resource
public Expression ApplyInclude(IncludeExpression include)
{
- ArgumentGuard.NotNull(include, nameof(include));
+ ArgumentGuard.NotNull(include);
return Visit(include, null);
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameFactory.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameFactory.cs
index 864b71c843..32691e05ab 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameFactory.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameFactory.cs
@@ -13,7 +13,7 @@ public sealed class LambdaParameterNameFactory
public LambdaParameterNameScope Create(string typeName)
{
- ArgumentGuard.NotNullNorEmpty(typeName, nameof(typeName));
+ ArgumentGuard.NotNullNorEmpty(typeName);
string parameterName = typeName.Camelize();
parameterName = EnsureNameIsUnique(parameterName);
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameScope.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameScope.cs
index 2bad41d310..031dae0a0f 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameScope.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaParameterNameScope.cs
@@ -11,8 +11,8 @@ public sealed class LambdaParameterNameScope : IDisposable
public LambdaParameterNameScope(string name, LambdaParameterNameFactory owner)
{
- ArgumentGuard.NotNullNorEmpty(name, nameof(name));
- ArgumentGuard.NotNull(owner, nameof(owner));
+ ArgumentGuard.NotNullNorEmpty(name);
+ ArgumentGuard.NotNull(owner);
Name = name;
_owner = owner;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScope.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScope.cs
index e5502031a3..52caddbe62 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScope.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScope.cs
@@ -23,8 +23,8 @@ private LambdaScope(LambdaParameterNameScope parameterNameScope, ParameterExpres
public static LambdaScope Create(LambdaParameterNameFactory nameFactory, Type elementType, Expression? accessorExpression)
{
- ArgumentGuard.NotNull(nameFactory, nameof(nameFactory));
- ArgumentGuard.NotNull(elementType, nameof(elementType));
+ ArgumentGuard.NotNull(nameFactory);
+ ArgumentGuard.NotNull(elementType);
LambdaParameterNameScope parameterNameScope = nameFactory.Create(elementType.Name);
ParameterExpression parameter = Expression.Parameter(elementType, parameterNameScope.Name);
@@ -35,7 +35,7 @@ public static LambdaScope Create(LambdaParameterNameFactory nameFactory, Type el
public LambdaScope WithAccessor(Expression accessorExpression)
{
- ArgumentGuard.NotNull(accessorExpression, nameof(accessorExpression));
+ ArgumentGuard.NotNull(accessorExpression);
return new LambdaScope(_parameterNameScope, Parameter, accessorExpression);
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScopeFactory.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScopeFactory.cs
index 9c13a63d28..6e4955cf40 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScopeFactory.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/LambdaScopeFactory.cs
@@ -10,14 +10,14 @@ public sealed class LambdaScopeFactory
public LambdaScopeFactory(LambdaParameterNameFactory nameFactory)
{
- ArgumentGuard.NotNull(nameFactory, nameof(nameFactory));
+ ArgumentGuard.NotNull(nameFactory);
_nameFactory = nameFactory;
}
public LambdaScope CreateScope(Type elementType, Expression? accessorExpression = null)
{
- ArgumentGuard.NotNull(elementType, nameof(elementType));
+ ArgumentGuard.NotNull(elementType);
return LambdaScope.Create(_nameFactory, elementType, accessorExpression);
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/OrderClauseBuilder.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/OrderClauseBuilder.cs
index 7ae8dd2392..775893adcc 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/OrderClauseBuilder.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/OrderClauseBuilder.cs
@@ -17,8 +17,8 @@ public class OrderClauseBuilder : QueryClauseBuilder
public OrderClauseBuilder(Expression source, LambdaScope lambdaScope, Type extensionType)
: base(lambdaScope)
{
- ArgumentGuard.NotNull(source, nameof(source));
- ArgumentGuard.NotNull(extensionType, nameof(extensionType));
+ ArgumentGuard.NotNull(source);
+ ArgumentGuard.NotNull(extensionType);
_source = source;
_extensionType = extensionType;
@@ -26,7 +26,7 @@ public OrderClauseBuilder(Expression source, LambdaScope lambdaScope, Type exten
public Expression ApplyOrderBy(SortExpression expression)
{
- ArgumentGuard.NotNull(expression, nameof(expression));
+ ArgumentGuard.NotNull(expression);
return Visit(expression, null);
}
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryClauseBuilder.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryClauseBuilder.cs
index d04ff57e9d..fdbb3bc0c3 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryClauseBuilder.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryClauseBuilder.cs
@@ -14,7 +14,7 @@ public abstract class QueryClauseBuilder : QueryExpressionVisitor(Expression accessorExpression, Func action)
{
- ArgumentGuard.NotNull(accessorExpression, nameof(accessorExpression));
- ArgumentGuard.NotNull(action, nameof(action));
+ ArgumentGuard.NotNull(accessorExpression);
+ ArgumentGuard.NotNull(action);
LambdaScope backupScope = LambdaScope;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryableBuilder.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryableBuilder.cs
index d571ac1dce..a497846285 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryableBuilder.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/QueryableBuilder.cs
@@ -24,12 +24,12 @@ public class QueryableBuilder
public QueryableBuilder(Expression source, Type elementType, Type extensionType, LambdaParameterNameFactory nameFactory, IResourceFactory resourceFactory,
IModel entityModel, LambdaScopeFactory? lambdaScopeFactory = null)
{
- ArgumentGuard.NotNull(source, nameof(source));
- ArgumentGuard.NotNull(elementType, nameof(elementType));
- ArgumentGuard.NotNull(extensionType, nameof(extensionType));
- ArgumentGuard.NotNull(nameFactory, nameof(nameFactory));
- ArgumentGuard.NotNull(resourceFactory, nameof(resourceFactory));
- ArgumentGuard.NotNull(entityModel, nameof(entityModel));
+ ArgumentGuard.NotNull(source);
+ ArgumentGuard.NotNull(elementType);
+ ArgumentGuard.NotNull(extensionType);
+ ArgumentGuard.NotNull(nameFactory);
+ ArgumentGuard.NotNull(resourceFactory);
+ ArgumentGuard.NotNull(entityModel);
_source = source;
_elementType = elementType;
@@ -42,7 +42,7 @@ public QueryableBuilder(Expression source, Type elementType, Type extensionType,
public virtual Expression ApplyQuery(QueryLayer layer)
{
- ArgumentGuard.NotNull(layer, nameof(layer));
+ ArgumentGuard.NotNull(layer);
Expression expression = _source;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SelectClauseBuilder.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SelectClauseBuilder.cs
index 690c49de24..1f1c10301a 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SelectClauseBuilder.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SelectClauseBuilder.cs
@@ -31,11 +31,11 @@ public SelectClauseBuilder(Expression source, LambdaScope lambdaScope, IModel en
IResourceFactory resourceFactory)
: base(lambdaScope)
{
- ArgumentGuard.NotNull(source, nameof(source));
- ArgumentGuard.NotNull(entityModel, nameof(entityModel));
- ArgumentGuard.NotNull(extensionType, nameof(extensionType));
- ArgumentGuard.NotNull(nameFactory, nameof(nameFactory));
- ArgumentGuard.NotNull(resourceFactory, nameof(resourceFactory));
+ ArgumentGuard.NotNull(source);
+ ArgumentGuard.NotNull(entityModel);
+ ArgumentGuard.NotNull(extensionType);
+ ArgumentGuard.NotNull(nameFactory);
+ ArgumentGuard.NotNull(resourceFactory);
_source = source;
_entityModel = entityModel;
@@ -46,7 +46,7 @@ public SelectClauseBuilder(Expression source, LambdaScope lambdaScope, IModel en
public Expression ApplySelect(FieldSelection selection, ResourceType resourceType)
{
- ArgumentGuard.NotNull(selection, nameof(selection));
+ ArgumentGuard.NotNull(selection);
Expression bodyInitializer = CreateLambdaBodyInitializer(selection, resourceType, LambdaScope, false);
@@ -272,7 +272,7 @@ private sealed class PropertySelector
public PropertySelector(PropertyInfo property, QueryLayer? nextLayer = null)
{
- ArgumentGuard.NotNull(property, nameof(property));
+ ArgumentGuard.NotNull(property);
Property = property;
NextLayer = nextLayer;
diff --git a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SkipTakeClauseBuilder.cs b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SkipTakeClauseBuilder.cs
index 4bb9bfd6f5..90109dbfec 100644
--- a/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SkipTakeClauseBuilder.cs
+++ b/src/JsonApiDotNetCore/Queries/Internal/QueryableBuilding/SkipTakeClauseBuilder.cs
@@ -17,8 +17,8 @@ public class SkipTakeClauseBuilder : QueryClauseBuilder