Requires.ValidElements 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.
Overloads
ValidElements<T>(IEnumerable<T>, Predicate<T>, String, String) |
Throws an exception if |
ValidElements<T>(IEnumerable<T>, Predicate<T>, String, String, Object[]) |
Throws an exception if |
ValidElements<T>(IEnumerable<T>, Predicate<T>, String, String)
Throws an exception if values
is null,
predicate
is null, or if values
is not null
and has an element which does not match the given predicate.
public:
generic <typename T>
static void ValidElements(System::Collections::Generic::IEnumerable<T> ^ values, Predicate<T> ^ predicate, System::String ^ parameterName, System::String ^ message);
[System.Diagnostics.DebuggerStepThrough]
public static void ValidElements<T> (System.Collections.Generic.IEnumerable<T> values, Predicate<T> predicate, string? parameterName, string? message);
[<System.Diagnostics.DebuggerStepThrough>]
static member ValidElements : seq<'T> * Predicate<'T> * string * string -> unit
Public Shared Sub ValidElements(Of T) (values As IEnumerable(Of T), predicate As Predicate(Of T), parameterName As String, message As String)
Type Parameters
- T
The type of the elements in the sequence.
Parameters
- values
- IEnumerable<T>
The value of the argument.
- predicate
- Predicate<T>
The predicate used to test the elements.
- parameterName
- String
The name of the parameter to include in any thrown exception.
- message
- String
A message to be used in the resulting exception.
- Attributes
Exceptions
Thrown if the tested condition is false.
Thrown if predicate
or values
is null
.
Applies to
ValidElements<T>(IEnumerable<T>, Predicate<T>, String, String, Object[])
Throws an exception if values
is null,
predicate
is null, or if values
is not null
and has an element which does not match the given predicate.
public:
generic <typename T>
static void ValidElements(System::Collections::Generic::IEnumerable<T> ^ values, Predicate<T> ^ predicate, System::String ^ parameterName, System::String ^ unformattedMessage, ... cli::array <System::Object ^> ^ args);
[System.Diagnostics.DebuggerStepThrough]
public static void ValidElements<T> (System.Collections.Generic.IEnumerable<T> values, Predicate<T> predicate, string? parameterName, string unformattedMessage, params object?[] args);
[<System.Diagnostics.DebuggerStepThrough>]
static member ValidElements : seq<'T> * Predicate<'T> * string * string * obj[] -> unit
Public Shared Sub ValidElements(Of T) (values As IEnumerable(Of T), predicate As Predicate(Of T), parameterName As String, unformattedMessage As String, ParamArray args As Object())
Type Parameters
- T
The type of the elements in the sequence.
Parameters
- values
- IEnumerable<T>
The value of the argument.
- predicate
- Predicate<T>
The predicate used to test the elements.
- parameterName
- String
The name of the parameter to include in any thrown exception.
- unformattedMessage
- String
The unformatted message.
- args
- Object[]
Formatting arguments.
- Attributes
Exceptions
Thrown if the tested condition is false.
Thrown if predicate
is null
.