Skip to content

Commit 47ac16b

Browse files
committed
Reduce the use of nameof() in parameter validations by using CallerArgumentExpressionAttribute instead
1 parent e079a66 commit 47ac16b

File tree

159 files changed

+529
-528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+529
-528
lines changed

JsonApiDotNetCore.sln.DotSettings

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,12 @@ JsonApiDotNetCore.ArgumentGuard.NotNull($EXPR$, $NAME$);</s:String>
600600
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=546845333F49494AB6CF8F0477A0F71D/LanguageName/@EntryValue">CSHARP</s:String>
601601
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=546845333F49494AB6CF8F0477A0F71D/MatchCatchClauseWithoutExceptionFilter/@EntryValue">False</s:Boolean>
602602
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=546845333F49494AB6CF8F0477A0F71D/ReplaceComment/@EntryValue">Replace argument null check with Guard clause</s:String>
603-
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=546845333F49494AB6CF8F0477A0F71D/ReplacePattern/@EntryValue">JsonApiDotNetCore.ArgumentGuard.NotNull($argument$, nameof($argument$));&#xD;
603+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=546845333F49494AB6CF8F0477A0F71D/ReplacePattern/@EntryValue">JsonApiDotNetCore.ArgumentGuard.NotNull($argument$);&#xD;
604604
$left$ = $right$;</s:String>
605605
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=546845333F49494AB6CF8F0477A0F71D/SearchPattern/@EntryValue">$left$ = $right$ ?? throw new ArgumentNullException(nameof($argument$));</s:String>
606606
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=546845333F49494AB6CF8F0477A0F71D/Severity/@EntryValue">WARNING</s:String>
607607
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/@KeyIndexDefined">True</s:Boolean>
608-
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/Comment/@EntryValue">Replace classic argument null check with Guard clause</s:String>
608+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/Comment/@EntryValue">Replace argument == null check with Guard clause</s:String>
609609
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/CustomPatternPlaceholder/=argument/@KeyIndexDefined">True</s:Boolean>
610610
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/CustomPatternPlaceholder/=argument/Properties/=CaseSensitive/@EntryIndexedValue">True</s:String>
611611
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/CustomPatternPlaceholder/=argument/Properties/=ExactType/@EntryIndexedValue">False</s:String>
@@ -615,7 +615,7 @@ $left$ = $right$;</s:String>
615615
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/LanguageName/@EntryValue">CSHARP</s:String>
616616
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/MatchCatchClauseWithoutExceptionFilter/@EntryValue">False</s:Boolean>
617617
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/ReplaceComment/@EntryValue">Replace argument null check with Guard clause</s:String>
618-
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/ReplacePattern/@EntryValue">JsonApiDotNetCore.ArgumentGuard.NotNull($argument$, nameof($argument$));</s:String>
618+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/ReplacePattern/@EntryValue">JsonApiDotNetCore.ArgumentGuard.NotNull($argument$);</s:String>
619619
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/SearchPattern/@EntryValue">if ($argument$ == null) throw new ArgumentNullException(nameof($argument$));</s:String>
620620
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=67F8FFFFE7DCA24889232D6952BDFD59/Severity/@EntryValue">WARNING</s:String>
621621
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=B3D9EE6B4EC62A4F961EB15F9ADEC2C6/@KeyIndexDefined">True</s:Boolean>
@@ -631,6 +631,19 @@ $left$ = $right$;</s:String>
631631
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=B3D9EE6B4EC62A4F961EB15F9ADEC2C6/ReplacePattern/@EntryValue">$collection$.IsNullOrEmpty()</s:String>
632632
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=B3D9EE6B4EC62A4F961EB15F9ADEC2C6/SearchPattern/@EntryValue">$collection$ == null || !$collection$.Any()</s:String>
633633
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=B3D9EE6B4EC62A4F961EB15F9ADEC2C6/Severity/@EntryValue">WARNING</s:String>
634+
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/@KeyIndexDefined">True</s:Boolean>
635+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/Comment/@EntryValue">Replace argument is null check with Guard clause</s:String>
636+
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/CustomPatternPlaceholder/=argument/@KeyIndexDefined">True</s:Boolean>
637+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/CustomPatternPlaceholder/=argument/Properties/=CaseSensitive/@EntryIndexedValue">True</s:String>
638+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/CustomPatternPlaceholder/=argument/Properties/=ExactType/@EntryIndexedValue">False</s:String>
639+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/CustomPatternPlaceholder/=argument/Properties/=RegEx/@EntryIndexedValue"></s:String>
640+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/CustomPatternPlaceholder/=argument/Type/@EntryValue">IdentifierPlaceholder</s:String>
641+
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/IsReplacePattern/@EntryValue">True</s:Boolean>
642+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/LanguageName/@EntryValue">CSHARP</s:String>
643+
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/MatchCatchClauseWithoutExceptionFilter/@EntryValue">False</s:Boolean>
644+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/ReplacePattern/@EntryValue">JsonApiDotNetCore.ArgumentGuard.NotNull($argument$);</s:String>
645+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/SearchPattern/@EntryValue">if ($argument$ is null) throw new ArgumentNullException(nameof($argument$));</s:String>
646+
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=D29C3A091CD9E74BBFDF1B8974F5A977/Severity/@EntryValue">WARNING</s:String>
634647
<s:Boolean x:Key="/Default/UserDictionary/Words/=Accurize/@EntryIndexedValue">True</s:Boolean>
635648
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
636649
<s:Boolean x:Key="/Default/UserDictionary/Words/=Assignee/@EntryIndexedValue">True</s:Boolean>
Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,40 @@
1+
using System.Runtime.CompilerServices;
12
using JetBrains.Annotations;
23
using SysNotNull = System.Diagnostics.CodeAnalysis.NotNullAttribute;
34

45
#pragma warning disable AV1008 // Class should not be static
6+
#pragma warning disable AV1553 // Do not use optional parameters with default value null for strings, collections or tasks
57

68
namespace JsonApiDotNetCore;
79

810
internal static class ArgumentGuard
911
{
1012
[AssertionMethod]
11-
public static void NotNull<T>([NoEnumeration] [SysNotNull] T? value, [InvokerParameterName] string name)
13+
public static void NotNull<T>([NoEnumeration] [SysNotNull] T? value, [CallerArgumentExpression("value")] string? parameterName = null)
1214
where T : class
1315
{
14-
if (value is null)
15-
{
16-
throw new ArgumentNullException(name);
17-
}
18-
}
19-
20-
[AssertionMethod]
21-
public static void NotNullNorEmpty<T>([SysNotNull] IEnumerable<T>? value, [InvokerParameterName] string name)
22-
{
23-
NotNull(value, name);
24-
25-
if (!value.Any())
26-
{
27-
throw new ArgumentException($"Must have one or more {name}.", name);
28-
}
16+
ArgumentNullException.ThrowIfNull(value, parameterName);
2917
}
3018

3119
[AssertionMethod]
32-
public static void NotNullNorEmpty<T>([SysNotNull] IEnumerable<T>? value, [InvokerParameterName] string name, string collectionName)
20+
public static void NotNullNorEmpty<T>([SysNotNull] IEnumerable<T>? value, [CallerArgumentExpression("value")] string? parameterName = null)
3321
{
34-
NotNull(value, name);
22+
ArgumentNullException.ThrowIfNull(value, parameterName);
3523

3624
if (!value.Any())
3725
{
38-
throw new ArgumentException($"Must have one or more {collectionName}.", name);
26+
throw new ArgumentException("Collection cannot be null or empty.", parameterName);
3927
}
4028
}
4129

4230
[AssertionMethod]
43-
public static void NotNullNorEmpty([SysNotNull] string? value, [InvokerParameterName] string name)
31+
public static void NotNullNorEmpty([SysNotNull] string? value, [CallerArgumentExpression("value")] string? parameterName = null)
4432
{
45-
NotNull(value, name);
33+
ArgumentNullException.ThrowIfNull(value, parameterName);
4634

4735
if (value == string.Empty)
4836
{
49-
throw new ArgumentException("String cannot be null or empty.", name);
37+
throw new ArgumentException("String cannot be null or empty.", parameterName);
5038
}
5139
}
5240
}

src/JsonApiDotNetCore.Annotations/CollectionConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ internal sealed class CollectionConverter
2626
/// </param>
2727
public IEnumerable CopyToTypedCollection(IEnumerable source, Type collectionType)
2828
{
29-
ArgumentGuard.NotNull(source, nameof(source));
30-
ArgumentGuard.NotNull(collectionType, nameof(collectionType));
29+
ArgumentGuard.NotNull(source);
30+
ArgumentGuard.NotNull(collectionType);
3131

3232
Type concreteCollectionType = ToConcreteCollectionType(collectionType);
3333
dynamic concreteCollectionInstance = Activator.CreateInstance(concreteCollectionType)!;
@@ -121,7 +121,7 @@ public IReadOnlyCollection<IIdentifiable> ExtractResources(object? value)
121121
/// </summary>
122122
public bool TypeCanContainHashSet(Type collectionType)
123123
{
124-
ArgumentGuard.NotNull(collectionType, nameof(collectionType));
124+
ArgumentGuard.NotNull(collectionType);
125125

126126
if (collectionType.IsGenericType)
127127
{

src/JsonApiDotNetCore.Annotations/Configuration/ResourceType.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ public ResourceType(string publicName, Type clrType, Type identityClrType, IRead
100100
LinkTypes topLevelLinks = LinkTypes.NotConfigured, LinkTypes resourceLinks = LinkTypes.NotConfigured,
101101
LinkTypes relationshipLinks = LinkTypes.NotConfigured)
102102
{
103-
ArgumentGuard.NotNullNorEmpty(publicName, nameof(publicName));
104-
ArgumentGuard.NotNull(clrType, nameof(clrType));
105-
ArgumentGuard.NotNull(identityClrType, nameof(identityClrType));
103+
ArgumentGuard.NotNullNorEmpty(publicName);
104+
ArgumentGuard.NotNull(clrType);
105+
ArgumentGuard.NotNull(identityClrType);
106106

107107
PublicName = publicName;
108108
ClrType = clrType;
@@ -153,7 +153,7 @@ public AttrAttribute GetAttributeByPublicName(string publicName)
153153

154154
public AttrAttribute? FindAttributeByPublicName(string publicName)
155155
{
156-
ArgumentGuard.NotNull(publicName, nameof(publicName));
156+
ArgumentGuard.NotNull(publicName);
157157

158158
return _fieldsByPublicName.TryGetValue(publicName, out ResourceFieldAttribute? field) && field is AttrAttribute attribute ? attribute : null;
159159
}
@@ -167,7 +167,7 @@ public AttrAttribute GetAttributeByPropertyName(string propertyName)
167167

168168
public AttrAttribute? FindAttributeByPropertyName(string propertyName)
169169
{
170-
ArgumentGuard.NotNull(propertyName, nameof(propertyName));
170+
ArgumentGuard.NotNull(propertyName);
171171

172172
return _fieldsByPropertyName.TryGetValue(propertyName, out ResourceFieldAttribute? field) && field is AttrAttribute attribute ? attribute : null;
173173
}
@@ -180,7 +180,7 @@ public RelationshipAttribute GetRelationshipByPublicName(string publicName)
180180

181181
public RelationshipAttribute? FindRelationshipByPublicName(string publicName)
182182
{
183-
ArgumentGuard.NotNull(publicName, nameof(publicName));
183+
ArgumentGuard.NotNull(publicName);
184184

185185
return _fieldsByPublicName.TryGetValue(publicName, out ResourceFieldAttribute? field) && field is RelationshipAttribute relationship
186186
? relationship
@@ -197,7 +197,7 @@ public RelationshipAttribute GetRelationshipByPropertyName(string propertyName)
197197

198198
public RelationshipAttribute? FindRelationshipByPropertyName(string propertyName)
199199
{
200-
ArgumentGuard.NotNull(propertyName, nameof(propertyName));
200+
ArgumentGuard.NotNull(propertyName);
201201

202202
return _fieldsByPropertyName.TryGetValue(propertyName, out ResourceFieldAttribute? field) && field is RelationshipAttribute relationship
203203
? relationship
@@ -217,7 +217,7 @@ public IReadOnlySet<ResourceType> GetAllConcreteDerivedTypes()
217217
/// </summary>
218218
public ResourceType GetTypeOrDerived(Type clrType)
219219
{
220-
ArgumentGuard.NotNull(clrType, nameof(clrType));
220+
ArgumentGuard.NotNull(clrType);
221221

222222
ResourceType? derivedType = FindTypeOrDerived(this, clrType);
223223

src/JsonApiDotNetCore.Annotations/Resources/Annotations/RelationshipAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public ResourceType RightType
5757
get => _rightType!;
5858
internal set
5959
{
60-
ArgumentGuard.NotNull(value, nameof(value));
60+
ArgumentGuard.NotNull(value);
6161
_rightType = value;
6262
}
6363
}

src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceFieldAttribute.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public PropertyInfo Property
4343
get => _property!;
4444
internal set
4545
{
46-
ArgumentGuard.NotNull(value, nameof(value));
46+
ArgumentGuard.NotNull(value);
4747
_property = value;
4848
}
4949
}
@@ -56,7 +56,7 @@ public ResourceType Type
5656
get => _type!;
5757
internal set
5858
{
59-
ArgumentGuard.NotNull(value, nameof(value));
59+
ArgumentGuard.NotNull(value);
6060
_type = value;
6161
}
6262
}
@@ -67,7 +67,7 @@ internal set
6767
/// </summary>
6868
public object? GetValue(object resource)
6969
{
70-
ArgumentGuard.NotNull(resource, nameof(resource));
70+
ArgumentGuard.NotNull(resource);
7171

7272
if (Property.GetMethod == null)
7373
{
@@ -92,7 +92,7 @@ internal set
9292
/// </summary>
9393
public void SetValue(object resource, object? newValue)
9494
{
95-
ArgumentGuard.NotNull(resource, nameof(resource));
95+
ArgumentGuard.NotNull(resource);
9696

9797
if (Property.SetMethod == null)
9898
{

src/JsonApiDotNetCore.Annotations/Resources/Internal/RuntimeTypeConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static class RuntimeTypeConverter
1010
{
1111
public static object? ConvertType(object? value, Type type)
1212
{
13-
ArgumentGuard.NotNull(type, nameof(type));
13+
ArgumentGuard.NotNull(type);
1414

1515
if (value == null)
1616
{

src/JsonApiDotNetCore.Annotations/TypeExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static bool IsOrImplementsInterface<TInterface>(this Type? source)
1515
/// </summary>
1616
private static bool IsOrImplementsInterface(this Type? source, Type interfaceType)
1717
{
18-
ArgumentGuard.NotNull(interfaceType, nameof(interfaceType));
18+
ArgumentGuard.NotNull(interfaceType);
1919

2020
if (source == null)
2121
{
@@ -41,7 +41,7 @@ private static bool AreTypesEqual(Type left, Type right, bool isLeftGeneric)
4141
/// </summary>
4242
public static string GetFriendlyTypeName(this Type type)
4343
{
44-
ArgumentGuard.NotNull(type, nameof(type));
44+
ArgumentGuard.NotNull(type);
4545

4646
// Based on https://stackoverflow.com/questions/2581642/how-do-i-get-the-type-name-of-a-generic-type-argument.
4747

src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransaction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public sealed class EntityFrameworkCoreTransaction : IOperationsTransaction
1919

2020
public EntityFrameworkCoreTransaction(IDbContextTransaction transaction, DbContext dbContext)
2121
{
22-
ArgumentGuard.NotNull(transaction, nameof(transaction));
23-
ArgumentGuard.NotNull(dbContext, nameof(dbContext));
22+
ArgumentGuard.NotNull(transaction);
23+
ArgumentGuard.NotNull(dbContext);
2424

2525
_transaction = transaction;
2626
_dbContext = dbContext;

src/JsonApiDotNetCore/AtomicOperations/EntityFrameworkCoreTransactionFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public sealed class EntityFrameworkCoreTransactionFactory : IOperationsTransacti
1515

1616
public EntityFrameworkCoreTransactionFactory(IDbContextResolver dbContextResolver, IJsonApiOptions options)
1717
{
18-
ArgumentGuard.NotNull(dbContextResolver, nameof(dbContextResolver));
19-
ArgumentGuard.NotNull(options, nameof(options));
18+
ArgumentGuard.NotNull(dbContextResolver);
19+
ArgumentGuard.NotNull(options);
2020

2121
_dbContextResolver = dbContextResolver;
2222
_options = options;

src/JsonApiDotNetCore/AtomicOperations/LocalIdTracker.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public void Reset()
1717
/// <inheritdoc />
1818
public void Declare(string localId, ResourceType resourceType)
1919
{
20-
ArgumentGuard.NotNullNorEmpty(localId, nameof(localId));
21-
ArgumentGuard.NotNull(resourceType, nameof(resourceType));
20+
ArgumentGuard.NotNullNorEmpty(localId);
21+
ArgumentGuard.NotNull(resourceType);
2222

2323
AssertIsNotDeclared(localId);
2424

@@ -36,9 +36,9 @@ private void AssertIsNotDeclared(string localId)
3636
/// <inheritdoc />
3737
public void Assign(string localId, ResourceType resourceType, string stringId)
3838
{
39-
ArgumentGuard.NotNullNorEmpty(localId, nameof(localId));
40-
ArgumentGuard.NotNull(resourceType, nameof(resourceType));
41-
ArgumentGuard.NotNullNorEmpty(stringId, nameof(stringId));
39+
ArgumentGuard.NotNullNorEmpty(localId);
40+
ArgumentGuard.NotNull(resourceType);
41+
ArgumentGuard.NotNullNorEmpty(stringId);
4242

4343
AssertIsDeclared(localId);
4444

@@ -57,8 +57,8 @@ public void Assign(string localId, ResourceType resourceType, string stringId)
5757
/// <inheritdoc />
5858
public string GetValue(string localId, ResourceType resourceType)
5959
{
60-
ArgumentGuard.NotNullNorEmpty(localId, nameof(localId));
61-
ArgumentGuard.NotNull(resourceType, nameof(resourceType));
60+
ArgumentGuard.NotNullNorEmpty(localId);
61+
ArgumentGuard.NotNull(resourceType);
6262

6363
AssertIsDeclared(localId);
6464

src/JsonApiDotNetCore/AtomicOperations/LocalIdValidator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ public sealed class LocalIdValidator
1818

1919
public LocalIdValidator(ILocalIdTracker localIdTracker, IResourceGraph resourceGraph)
2020
{
21-
ArgumentGuard.NotNull(localIdTracker, nameof(localIdTracker));
22-
ArgumentGuard.NotNull(resourceGraph, nameof(resourceGraph));
21+
ArgumentGuard.NotNull(localIdTracker);
22+
ArgumentGuard.NotNull(resourceGraph);
2323

2424
_localIdTracker = localIdTracker;
2525
_resourceGraph = resourceGraph;
2626
}
2727

2828
public void Validate(IEnumerable<OperationContainer> operations)
2929
{
30-
ArgumentGuard.NotNull(operations, nameof(operations));
30+
ArgumentGuard.NotNull(operations);
3131

3232
_localIdTracker.Reset();
3333

src/JsonApiDotNetCore/AtomicOperations/OperationProcessorAccessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ public class OperationProcessorAccessor : IOperationProcessorAccessor
1515

1616
public OperationProcessorAccessor(IServiceProvider serviceProvider)
1717
{
18-
ArgumentGuard.NotNull(serviceProvider, nameof(serviceProvider));
18+
ArgumentGuard.NotNull(serviceProvider);
1919

2020
_serviceProvider = serviceProvider;
2121
}
2222

2323
/// <inheritdoc />
2424
public Task<OperationContainer?> ProcessAsync(OperationContainer operation, CancellationToken cancellationToken)
2525
{
26-
ArgumentGuard.NotNull(operation, nameof(operation));
26+
ArgumentGuard.NotNull(operation);
2727

2828
IOperationProcessor processor = ResolveProcessor(operation);
2929
return processor.ProcessAsync(operation, cancellationToken);

0 commit comments

Comments
 (0)