Guard.IsNotEmpty 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
IsNotEmpty(String, String) |
Asserts that the input String instance must not be empty. |
IsNotEmpty<T>(ReadOnlySpan<T>, String) |
Asserts that the input ReadOnlySpan<T> instance must not be empty. |
IsNotEmpty<T>(T[], String) |
Asserts that the input array instance must not be empty. |
IsNotEmpty<T>(ReadOnlyMemory<T>, String) |
Asserts that the input ReadOnlyMemory<T> instance must not be empty. |
IsNotEmpty<T>(Span<T>, String) |
Asserts that the input Span<T> instance must not be empty. |
IsNotEmpty<T>(List<T>, String) |
Asserts that the input List<T> instance must not be empty. |
IsNotEmpty<T>(IReadOnlyCollection<T>, String) |
Asserts that the input IReadOnlyCollection<T> instance must not be empty. |
IsNotEmpty<T>(ICollection<T>, String) |
Asserts that the input ICollection<T> instance must not be empty. |
IsNotEmpty<T>(Memory<T>, String) |
Asserts that the input Memory<T> instance must not be empty. |
IsNotEmpty(String, String)
Asserts that the input String instance must not be empty.
public static void IsNotEmpty (string text, string name);
static member IsNotEmpty : string * string -> unit
Public Shared Sub IsNotEmpty (text As String, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if text
is empty.
Applies to
IsNotEmpty<T>(ReadOnlySpan<T>, String)
Asserts that the input ReadOnlySpan<T> instance must not be empty.
public static void IsNotEmpty<T> (ReadOnlySpan<T> span, string name);
static member IsNotEmpty : ReadOnlySpan<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (span As ReadOnlySpan(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlySpan<T> instance.
Parameters
- span
- ReadOnlySpan<T>
The input ReadOnlySpan<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of span
is == 0.
Applies to
IsNotEmpty<T>(T[], String)
Asserts that the input array instance must not be empty.
public static void IsNotEmpty<T> (T[] array, string name);
static member IsNotEmpty : 'T[] * string -> unit
Public Shared Sub IsNotEmpty(Of T) (array As T(), name As String)
Type Parameters
- T
The item of items in the input array instance.
Parameters
- array
- T[]
The input array instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of array
is == 0.
Applies to
IsNotEmpty<T>(ReadOnlyMemory<T>, String)
Asserts that the input ReadOnlyMemory<T> instance must not be empty.
public static void IsNotEmpty<T> (ReadOnlyMemory<T> memory, string name);
static member IsNotEmpty : ReadOnlyMemory<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (memory As ReadOnlyMemory(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlyMemory<T> instance.
Parameters
- memory
- ReadOnlyMemory<T>
The input ReadOnlyMemory<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of memory
is == 0.
Applies to
IsNotEmpty<T>(Span<T>, String)
Asserts that the input Span<T> instance must not be empty.
public static void IsNotEmpty<T> (Span<T> span, string name);
static member IsNotEmpty : Span<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (span As Span(Of T), name As String)
Type Parameters
- T
The item of items in the input Span<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of span
is == 0.
Applies to
IsNotEmpty<T>(List<T>, String)
Asserts that the input List<T> instance must not be empty.
public static void IsNotEmpty<T> (System.Collections.Generic.List<T> list, string name);
static member IsNotEmpty : System.Collections.Generic.List<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (list As List(Of T), name As String)
Type Parameters
- T
The item of items in the input List<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of list
is == 0.
Applies to
IsNotEmpty<T>(IReadOnlyCollection<T>, String)
Asserts that the input IReadOnlyCollection<T> instance must not be empty.
public static void IsNotEmpty<T> (System.Collections.Generic.IReadOnlyCollection<T> collection, string name);
static member IsNotEmpty : System.Collections.Generic.IReadOnlyCollection<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IReadOnlyCollection(Of T), name As String)
Type Parameters
- T
The item of items in the input IReadOnlyCollection<T> instance.
Parameters
- collection
- IReadOnlyCollection<T>
The input IReadOnlyCollection<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of collection
is == 0.
Applies to
IsNotEmpty<T>(ICollection<T>, String)
Asserts that the input ICollection<T> instance must not be empty.
public static void IsNotEmpty<T> (System.Collections.Generic.ICollection<T> collection, string name);
static member IsNotEmpty : System.Collections.Generic.ICollection<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As ICollection(Of T), name As String)
Type Parameters
- T
The item of items in the input ICollection<T> instance.
Parameters
- collection
- ICollection<T>
The input ICollection<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of collection
is == 0.
Applies to
IsNotEmpty<T>(Memory<T>, String)
Asserts that the input Memory<T> instance must not be empty.
public static void IsNotEmpty<T> (Memory<T> memory, string name);
static member IsNotEmpty : Memory<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (memory As Memory(Of T), name As String)
Type Parameters
- T
The item of items in the input Memory<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of memory
is == 0.