From c08c3b6dae0f39d27043d2c61ca2ae9038c23927 Mon Sep 17 00:00:00 2001 From: Weihan Li <7604648+WeihanLi@users.noreply.github.com> Date: Wed, 23 Oct 2024 07:47:53 +0800 Subject: [PATCH] use nameof for CallerArgumentExpression --- src/Microsoft.OpenApi/Utils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi/Utils.cs b/src/Microsoft.OpenApi/Utils.cs index 10d5595f8..b025af8e7 100644 --- a/src/Microsoft.OpenApi/Utils.cs +++ b/src/Microsoft.OpenApi/Utils.cs @@ -20,7 +20,7 @@ internal static class Utils /// The input value. internal static T CheckArgumentNull( T value, - [CallerArgumentExpression("value")] string parameterName = "") + [CallerArgumentExpression(nameof(value))] string parameterName = "") { return value ?? throw new ArgumentNullException(parameterName, $"Value cannot be null: {parameterName}"); }