From 3bf19a113cbdb09012c14cc253f146ec822de11c Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Mon, 9 Dec 2024 08:36:19 +0800 Subject: [PATCH] use nameof for CallerArgumentExpression (#2562) --- src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs b/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs index 904072415..21b3466ed 100644 --- a/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs +++ b/src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs @@ -11,7 +11,7 @@ internal static partial class ArgumentNullThrowHelper /// Throws an if is null. /// The reference type argument to validate as non-null. /// The name of the parameter with which corresponds. - 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)