다음을 통해 공유


Requires.NotDefault<T>(T, String) 메서드

정의

지정된 매개 변수의 값이 의 기본값과 같으면 을 TypeTthrow합니다ArgumentException.

public:
generic <typename T>
 where T : value class static void NotDefault(T value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotDefault<T>(T value, string? parameterName = default) where T : struct;
[<System.Diagnostics.DebuggerStepThrough>]
static member NotDefault : 'T * string -> unit (requires 'T : struct)
Public Shared Sub NotDefault(Of T As Structure) (value As T, Optional parameterName As String = Nothing)

형식 매개 변수

T

매개 변수의 형식입니다.

매개 변수

value
T

인수 값입니다.

parameterName
String

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

특성

예외

가 이거나 비어 있는 경우 value throw됩니다 null .

적용 대상