Show / Hide Table of Contents

Class ArgumentExceptionExtensions

Extends ArgumentException type.

Inheritance
object
ArgumentExceptionExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public static class ArgumentExceptionExtensions

Methods

View Source

BufferTooSmall(string?)

Creates ArgumentException that describes the empty buffer.

Declaration
public static ArgumentException BufferTooSmall(string? paramName)
Parameters
Type Name Description
string paramName

The name of the parameter.

Returns
Type Description
ArgumentException

An instance of exception.

View Source

EmptyCollection(string?)

Creates ArgumentException that describes the empty collection.

Declaration
public static ArgumentException EmptyCollection(string? paramName)
Parameters
Type Name Description
string paramName

The name of the parameter.

Returns
Type Description
ArgumentException

An instance of exception.

View Source

ThrowIfEmpty<T>(in Memory<T>, string?)

Throws if the input buffer is empty.

Declaration
public static void ThrowIfEmpty<T>(in Memory<T> memory, string? paramName = null)
Parameters
Type Name Description
Memory<T> memory

The buffer argument to validate.

string paramName

The name of the parameter with which argument corresponds.

Type Parameters
Name Description
T

The type of the elements in the buffer.

View Source

ThrowIfEmpty<T>(in ReadOnlyMemory<T>, string?)

Throws if the input buffer is empty.

Declaration
public static void ThrowIfEmpty<T>(in ReadOnlyMemory<T> memory, string? paramName = null)
Parameters
Type Name Description
ReadOnlyMemory<T> memory

The buffer argument to validate.

string paramName

The name of the parameter with which argument corresponds.

Type Parameters
Name Description
T

The type of the elements in the buffer.

View Source

ThrowIfEmpty<T>(ReadOnlySpan<T>, string?)

Throws if the input buffer is empty.

Declaration
public static void ThrowIfEmpty<T>(ReadOnlySpan<T> span, string? paramName = null)
Parameters
Type Name Description
ReadOnlySpan<T> span

The buffer argument to validate.

string paramName

The name of the parameter with which argument corresponds.

Type Parameters
Name Description
T

The type of the elements in the buffer.

View Source

ThrowIfEmpty<T>(Span<T>, string?)

Throws if the input buffer is empty.

Declaration
public static void ThrowIfEmpty<T>(Span<T> span, string? paramName = null)
Parameters
Type Name Description
Span<T> span

The buffer argument to validate.

string paramName

The name of the parameter with which argument corresponds.

Type Parameters
Name Description
T

The type of the elements in the buffer.

View Source

ThrowIfNullOrEmpty<T>(IReadOnlyCollection<T>?, string?)

Throws if the collection is empty.

Declaration
public static void ThrowIfNullOrEmpty<T>(IReadOnlyCollection<T>? collection, string? paramName = null)
Parameters
Type Name Description
IReadOnlyCollection<T> collection

The collection argument to validate.

string paramName

The name of the parameter with which argument corresponds.

Type Parameters
Name Description
T

The type of the elements in the collection.

View Source

ThrowIfShorterThan<T>(in Memory<T>, int, string?)

Throws if the length of memory is less than the desired value.

Declaration
public static void ThrowIfShorterThan<T>(in Memory<T> memory, int desiredLength, string? paramName = null)
Parameters
Type Name Description
Memory<T> memory

The memory to validate.

int desiredLength

The desired length.

string paramName

The name of the parameter with which argument corresponds.

Type Parameters
Name Description
T

The type of the elements in the buffer.

  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾