Skip to content

Commit

Permalink
Merge pull request #1886 from WeihanLi/patch-1
Browse files Browse the repository at this point in the history
use nameof for CallerArgumentExpression
  • Loading branch information
MaggieKimani1 authored Oct 24, 2024
2 parents 95e25ba + c08c3b6 commit f2fb6cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal static class Utils
/// <returns>The input value.</returns>
internal static T CheckArgumentNull<T>(
T value,
[CallerArgumentExpression("value")] string parameterName = "")
[CallerArgumentExpression(nameof(value))] string parameterName = "")
{
return value ?? throw new ArgumentNullException(parameterName, $"Value cannot be null: {parameterName}");
}
Expand Down

0 comments on commit f2fb6cc

Please sign in to comment.