Share via


Requires.NotNullOrEmpty Método

Definição

Sobrecargas

NotNullOrEmpty(IEnumerable, String)

Gera uma exceção se o valor do parâmetro especificado for nulo, não tiver elementos.

NotNullOrEmpty(String, String)

Gera uma exceção se o valor do parâmetro especificado for nulo ou vazio.

NotNullOrEmpty<T>(ICollection<T>, String)

Gera uma exceção se o valor do parâmetro especificado for nulo, não tiver elementos.

NotNullOrEmpty<T>(IEnumerable<T>, String)

Gera uma exceção se o valor do parâmetro especificado for nulo, não tiver elementos.

NotNullOrEmpty(IEnumerable, String)

Gera uma exceção se o valor do parâmetro especificado for nulo, não tiver elementos.

public:
 static void NotNullOrEmpty(System::Collections::IEnumerable ^ values, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrEmpty (System.Collections.IEnumerable values, string? parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrEmpty (System.Collections.IEnumerable values, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
static member NotNullOrEmpty : System.Collections.IEnumerable * string -> unit
Public Shared Sub NotNullOrEmpty (values As IEnumerable, parameterName As String)
Public Shared Sub NotNullOrEmpty (values As IEnumerable, Optional parameterName As String = Nothing)

Parâmetros

values
IEnumerable

O valor do argumento.

parameterName
String

O nome do parâmetro a ser incluído em qualquer exceção gerada. Se esse argumento for omitido (a gravação null explícita não se qualificará), a expressão usada no primeiro argumento será usada como o nome do parâmetro.

Atributos

Exceções

Gerado se a condição testada for falsa.

Aplica-se a

NotNullOrEmpty(String, String)

Gera uma exceção se o valor do parâmetro especificado for nulo ou vazio.

public:
 static void NotNullOrEmpty(System::String ^ value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrEmpty (string value, string? parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrEmpty (string value, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
static member NotNullOrEmpty : string * string -> unit
Public Shared Sub NotNullOrEmpty (value As String, parameterName As String)
Public Shared Sub NotNullOrEmpty (value As String, Optional parameterName As String = Nothing)

Parâmetros

value
String

O valor do argumento.

parameterName
String

O nome do parâmetro a ser incluído em qualquer exceção gerada. Se esse argumento for omitido (a gravação null explícita não se qualificará), a expressão usada no primeiro argumento será usada como o nome do parâmetro.

Atributos

Exceções

Gerado se value estiver null ou vazio.

Aplica-se a

NotNullOrEmpty<T>(ICollection<T>, String)

Gera uma exceção se o valor do parâmetro especificado for nulo, não tiver elementos.

public:
generic <typename T>
 static void NotNullOrEmpty(System::Collections::Generic::ICollection<T> ^ values, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrEmpty<T> (System.Collections.Generic.ICollection<T> values, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
static member NotNullOrEmpty : System.Collections.Generic.ICollection<'T> * string -> unit
Public Shared Sub NotNullOrEmpty(Of T) (values As ICollection(Of T), Optional parameterName As String = Nothing)

Parâmetros de tipo

T

O tipo de valor na coleção.

Parâmetros

values
ICollection<T>

O valor do argumento.

parameterName
String

O nome do parâmetro a ser incluído em qualquer exceção gerada. Se esse argumento for omitido (a gravação null explícita não se qualificará), a expressão usada no primeiro argumento será usada como o nome do parâmetro.

Atributos

Exceções

Gerado se a condição testada for falsa.

Aplica-se a

NotNullOrEmpty<T>(IEnumerable<T>, String)

Gera uma exceção se o valor do parâmetro especificado for nulo, não tiver elementos.

public:
generic <typename T>
 static void NotNullOrEmpty(System::Collections::Generic::IEnumerable<T> ^ values, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrEmpty<T> (System.Collections.Generic.IEnumerable<T> values, string? parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void NotNullOrEmpty<T> (System.Collections.Generic.IEnumerable<T> values, string? parameterName = default);
[<System.Diagnostics.DebuggerStepThrough>]
static member NotNullOrEmpty : seq<'T> * string -> unit
Public Shared Sub NotNullOrEmpty(Of T) (values As IEnumerable(Of T), parameterName As String)
Public Shared Sub NotNullOrEmpty(Of T) (values As IEnumerable(Of T), Optional parameterName As String = Nothing)

Parâmetros de tipo

T

O tipo produzido pela enumeração .

Parâmetros

values
IEnumerable<T>

O valor do argumento.

parameterName
String

O nome do parâmetro a ser incluído em qualquer exceção gerada. Se esse argumento for omitido (a gravação null explícita não se qualificará), a expressão usada no primeiro argumento será usada como o nome do parâmetro.

Atributos

Exceções

Gerado se a condição testada for falsa.

Aplica-se a