Skip to content

Commit

Permalink
use nameof for CallerArgumentExpression (#2562)
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi authored Dec 9, 2024
1 parent b6cfbd0 commit 3bf19a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static partial class ArgumentNullThrowHelper
/// <summary>Throws an <see cref="ArgumentNullException"/> if <paramref name="argument"/> is null.</summary>
/// <param name="argument">The reference type argument to validate as non-null.</param>
/// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
{
#if !NET6_0_OR_GREATER
if (argument is null)
Expand Down

0 comments on commit 3bf19a1

Please sign in to comment.