Requires.NotNullEmptyOrNullElements<T> 方法

定义

如果指定的参数的值为 null、没有元素或具有值为 null 的元素,则会引发异常。

public:
generic <typename T>
 where T : class static void NotNullEmptyOrNullElements(System::Collections::Generic::IEnumerable<T> ^ values, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullEmptyOrNullElements<T> (System.Collections.Generic.IEnumerable<T> values, string? parameterName) where T : class;
[<System.Diagnostics.DebuggerStepThrough>]
static member NotNullEmptyOrNullElements : seq<'T (requires 'T : null)> * string -> unit (requires 'T : null)
Public Shared Sub NotNullEmptyOrNullElements(Of T As Class) (values As IEnumerable(Of T), parameterName As String)

类型参数

T

序列中元素的类型。

参数

values
IEnumerable<T>

参数的值。

parameterName
String

要包含在任何引发的异常中的参数的名称。

属性

例外

在测试的条件为 false 时引发。

适用于