Requires.NotNullEmptyOrNullElements<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Throws an exception if the specified parameter's value is null, has no elements or has an element with a null value.
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]
public static void NotNullEmptyOrNullElements<T> (System.Collections.Generic.IEnumerable<T> values, string? parameterName = default) 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)
Public Shared Sub NotNullEmptyOrNullElements(Of T As Class) (values As IEnumerable(Of T), Optional parameterName As String = Nothing)
Type Parameters
- T
The type of the elements in the sequence.
Parameters
- values
- IEnumerable<T>
The value of the argument.
- parameterName
- String
The name of the parameter to include in any thrown exception. If this argument is omitted (explicitly writing null
does not qualify), the expression used in the first argument will be used as the parameter name.
- Attributes
Exceptions
Thrown if the tested condition is false.