File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change
1
+ #if ! NET6_0_OR_GREATER
2
+ // ReSharper disable once CheckNamespace
3
+ namespace Binkus . Compat ;
4
+
5
+ using System . Diagnostics . CodeAnalysis ;
6
+ using System . Runtime . CompilerServices ;
7
+ // [TypeForwardedTo(typeof(global::System.ArgumentNullException))]
8
+ public static class ArgumentNullException
9
+ {
10
+ /// <summary>Throws an <see cref="ArgumentNullException"/> if <paramref name="argument"/> is null.</summary>
11
+ /// <param name="argument">The reference type argument to validate as non-null.</param>
12
+ /// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
13
+ public static void ThrowIfNull ( [ NotNull ] object ? argument , [ CallerArgumentExpression ( nameof ( argument ) ) ] string ? paramName = null )
14
+ {
15
+ if ( argument is null ) throw new global ::System . ArgumentNullException ( paramName ) ;
16
+ }
17
+ }
18
+ #endif
You can’t perform that action at this time.
0 commit comments