다음을 통해 공유


Requires.NotNull 메서드

정의

오버로드

NotNull(IntPtr, String)

지정된 매개 변수의 값이 IntPtr.Zero이면 예외를 throw합니다.

NotNull(Task, String)

지정된 매개 변수의 값이 null이면 예외를 throw합니다.

NotNull<T>(Task<T>, String)

지정된 매개 변수의 값이 null이면 예외를 throw합니다.

NotNull<T>(T, String)

지정된 매개 변수의 값이 null이면 예외를 throw합니다.

NotNull(IntPtr, String)

지정된 매개 변수의 값이 IntPtr.Zero이면 예외를 throw합니다.

public:
 static IntPtr NotNull(IntPtr value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static IntPtr NotNull(IntPtr value, string? parameterName);
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static IntPtr NotNull(IntPtr value, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")>]
static member NotNull : nativeint * string -> nativeint
Public Shared Function NotNull (value As IntPtr, parameterName As String) As IntPtr
Public Shared Function NotNull (value As IntPtr, Optional parameterName As String = Nothing) As IntPtr

매개 변수

value
IntPtr

nativeint

인수 값입니다.

parameterName
String

throw된 예외에 포함할 매개 변수의 이름입니다. 이 인수를 생략하면(명시적으로 쓰기 null 가 적합하지 않음) 첫 번째 인수에 사용된 식이 매개 변수 이름으로 사용됩니다.

반환

IntPtr

nativeint

매개 변수의 값입니다.

특성

예외

가 이면 value throw됩니다 Zero.

적용 대상

NotNull(Task, String)

지정된 매개 변수의 값이 null이면 예외를 throw합니다.

public:
 static void NotNull(System::Threading::Tasks::Task ^ value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static void NotNull(System.Threading.Tasks.Task value, string? parameterName);
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static void NotNull(System.Threading.Tasks.Task value, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")>]
static member NotNull : System.Threading.Tasks.Task * string -> unit
Public Shared Sub NotNull (value As Task, parameterName As String)
Public Shared Sub NotNull (value As Task, Optional parameterName As String = Nothing)

매개 변수

value
Task

인수 값입니다.

parameterName
String

throw된 예외에 포함할 매개 변수의 이름입니다. 이 인수를 생략하면(명시적으로 쓰기 null 가 적합하지 않음) 첫 번째 인수에 사용된 식이 매개 변수 이름으로 사용됩니다.

특성

예외

가 이면 value throw됩니다 null.

설명

이 메서드를 사용하면 비동기 메서드가 C# 경고를 방지하기 위해 결과를 지역 변수에 할당할 필요 없이 Requires.NotNull을 사용할 수 있습니다.

적용 대상

NotNull<T>(Task<T>, String)

지정된 매개 변수의 값이 null이면 예외를 throw합니다.

public:
generic <typename T>
 static void NotNull(System::Threading::Tasks::Task<T> ^ value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static void NotNull<T>(System.Threading.Tasks.Task<T> value, string? parameterName);
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static void NotNull<T>(System.Threading.Tasks.Task<T> value, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")>]
static member NotNull : System.Threading.Tasks.Task<'T> * string -> unit
Public Shared Sub NotNull(Of T) (value As Task(Of T), parameterName As String)
Public Shared Sub NotNull(Of T) (value As Task(Of T), Optional parameterName As String = Nothing)

형식 매개 변수

T

작업의 반환 값 형식입니다.

매개 변수

value
Task<T>

인수 값입니다.

parameterName
String

throw된 예외에 포함할 매개 변수의 이름입니다. 이 인수를 생략하면(명시적으로 쓰기 null 가 적합하지 않음) 첫 번째 인수에 사용된 식이 매개 변수 이름으로 사용됩니다.

특성

예외

가 이면 value throw됩니다 null.

설명

이 메서드를 사용하면 비동기 메서드가 C# 경고를 방지하기 위해 결과를 지역 변수에 할당할 필요 없이 Requires.NotNull을 사용할 수 있습니다.

적용 대상

NotNull<T>(T, String)

지정된 매개 변수의 값이 null이면 예외를 throw합니다.

public:
generic <typename T>
 where T : class static T NotNull(T value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static T NotNull<T>(T value, string? parameterName) where T : class;
[System.Diagnostics.DebuggerStepThrough]
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
public static T NotNull<T>(T value, string? parameterName = default) where T : class;
[<System.Diagnostics.DebuggerStepThrough>]
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")>]
static member NotNull : 'T * string -> 'T (requires 'T : null)
Public Shared Function NotNull(Of T As Class) (value As T, parameterName As String) As T
Public Shared Function NotNull(Of T As Class) (value As T, Optional parameterName As String = Nothing) As T

형식 매개 변수

T

매개 변수의 형식입니다.

매개 변수

value
T

인수 값입니다.

parameterName
String

throw된 예외에 포함할 매개 변수의 이름입니다. 이 인수를 생략하면(명시적으로 쓰기 null 가 적합하지 않음) 첫 번째 인수에 사용된 식이 매개 변수 이름으로 사용됩니다.

반환

T

매개 변수의 값입니다.

특성

예외

가 이면 value throw됩니다 null.

적용 대상