Edit

Share via


Guard.IsNotEmpty Method

Definition

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 <see typeparamref="T"></see> 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)

Source:
Guard.String.cs
Source:
Guard.String.cs

Asserts that the input String instance must not be empty.

public static void IsNotEmpty(string text, string name = "");
public static void IsNotEmpty(string text, string name);
static member IsNotEmpty : string * string -> unit
Public Shared Sub IsNotEmpty (text As String, Optional name As String = "")
Public Shared Sub IsNotEmpty (text As String, name As String)

Parameters

text
String

The input String instance to test.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if text is empty.

Applies to

IsNotEmpty<T>(ReadOnlySpan<T>, String)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input ReadOnlySpan<T> instance must not be empty.

public static void IsNotEmpty<T>(ReadOnlySpan<T> span, string name = "");
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), Optional name As String = "")
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)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input <see typeparamref="T"></see> array instance must not be empty.

public static void IsNotEmpty<T>(T[] array, string name = "");
public static void IsNotEmpty<T>(T[] array, string name);
static member IsNotEmpty : 'T[] * string -> unit
Public Shared Sub IsNotEmpty(Of T) (array As T(), Optional name As String = "")
Public Shared Sub IsNotEmpty(Of T) (array As T(), name As String)

Type Parameters

T

The item of items in the input <see typeparamref="T"></see> array instance.

Parameters

array
T[]

The input <see typeparamref="T"></see> 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)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input ReadOnlyMemory<T> instance must not be empty.

public static void IsNotEmpty<T>(ReadOnlyMemory<T> memory, string name = "");
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), Optional name As String = "")
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)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input Span<T> instance must not be empty.

public static void IsNotEmpty<T>(Span<T> span, string name = "");
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), Optional name As String = "")
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

span
Span<T>

The input Span<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>(List<T>, String)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input List<T> instance must not be empty.

public static void IsNotEmpty<T>(System.Collections.Generic.List<T> list, string name = "");
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), Optional name As String = "")
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

list
List<T>

The input List<T> instance to check the size for.

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)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input IReadOnlyCollection<T> instance must not be empty.

public static void IsNotEmpty<T>(System.Collections.Generic.IReadOnlyCollection<T> collection, string name = "");
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), Optional name As String = "")
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)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input ICollection<T> instance must not be empty.

public static void IsNotEmpty<T>(System.Collections.Generic.ICollection<T> collection, string name = "");
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), Optional name As String = "")
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)

Source:
Guard.Collection.g.cs
Source:
Guard.Collection.g.cs

Asserts that the input Memory<T> instance must not be empty.

public static void IsNotEmpty<T>(Memory<T> memory, string name = "");
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), Optional name As String = "")
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

memory
Memory<T>

The input Memory<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