Skip to content

Commit 26ff630

Browse files
SimonCroppjoemcbride
authored andcommitted
Add name to ArgumentNullExceptions (graphql-dotnet#752)
1 parent f4f97de commit 26ff630

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/GraphQL/Resolvers/AsyncFieldResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class AsyncFieldResolver<TSourceType, TReturnType> : IFieldResolver<Task<
3030

3131
public AsyncFieldResolver(Func<ResolveFieldContext<TSourceType>, Task<TReturnType>> resolver)
3232
{
33-
_resolver = resolver ?? throw new ArgumentNullException("A resolver function must be specified");
33+
_resolver = resolver ?? throw new ArgumentNullException(nameof(resolver), "A resolver function must be specified");
3434
}
3535

3636
public Task<TReturnType> Resolve(ResolveFieldContext context)

src/GraphQL/Resolvers/FuncFieldResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public FuncFieldResolver(Func<ResolveFieldContext<TSourceType>, TReturnType> res
3131
{
3232
if (resolver == null)
3333
{
34-
throw new ArgumentNullException("A resolver function must be specified");
34+
throw new ArgumentNullException(nameof(resolver), "A resolver function must be specified");
3535
}
3636
_resolver = resolver;
3737
}

src/GraphQL/StringExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static string[] ToDelimitedArray(this string content, char delimiter)
4949
/// <param name="this">The this.</param>
5050
public static IEnumerable<char> ToEnumerable(this string @this)
5151
{
52-
if (@this == null) throw new ArgumentNullException("@this");
52+
if (@this == null) throw new ArgumentNullException(nameof(@this));
5353

5454
for (var i = 0; i < @this.Length; ++i)
5555
{

0 commit comments

Comments
 (0)