Skip to content

Commit

Permalink
Merge pull request #2308 from WeihanLi/patch-1
Browse files Browse the repository at this point in the history
Update CallerArgumentExpressionAttribute.cs
  • Loading branch information
eerhardt authored Nov 25, 2024
2 parents 508123e + 703286b commit 0b1b657
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CallerArgumentExpressionAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ internal sealed class NotNullAttribute : Attribute

#endif

internal class Guard
internal static class Guard
{
/// <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="throwOnEmptyString">Only applicable to strings.</param>
/// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
public static T ThrowIfNull<T>([NotNull] T? argument, bool throwOnEmptyString = false, [CallerArgumentExpression("argument")] string? paramName = null)
public static T ThrowIfNull<T>([NotNull] T? argument, bool throwOnEmptyString = false, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
where T : class
{
#if NET6_0_OR_GREATER
Expand Down

0 comments on commit 0b1b657

Please sign in to comment.