ParamExtensions Class

Provides the checks of a chain that starts with Param.Check, or with one of the CheckNotNull methods of Param.

public static class ParamExtensions

Remarks

A check throws an exception if the value of the parameter is not valid. Otherwise, it returns a Param<T>, so that another check can follow.

Every check takes an optional message for the exception it throws. The message is a composite format string, that String.Format processes only if the check fails. The format item {0} is the name of the parameter, and {1} is its value. The format items from {2} on are the arguments of the check, in their order. A check that tests a property of the value, such as the length of a string, adds that property as the last format item. The description of the message parameter of each check lists its format items. ExceptionHelper.FormatObject converts each value to text. A message that is not a valid composite format string is used as it is.

Example

The following code checks the arguments of a constructor:

public Connection(string host, int port, TimeSpan timeout)
{
    Host = Param.NotNullOrWhiteSpace(host);
    Port = Param.Check(port).BetweenOrEqualTo(1, 65535, "{0} must be a port number, and {1} is not.").Value;
    Timeout = Param.Check(timeout).GreaterThan(TimeSpan.Zero).Value;
}

Methods

NameDescription
Param<object>.AssignableTo<TTarget>(string?)Throws an ArgumentException if the value of a parameter cannot be assigned to a specified type, and continues the chain with that type.
Param<T>.AssignableTo(Type, string?)Throws an ArgumentException if the value of a parameter cannot be assigned to a specified type.
Param<T>.AtEndPosition(string?)Throws an ArgumentException if the value of a stream parameter is not at its end position.
Param<T>.AtStartPosition(string?)Throws an ArgumentException if the value of a stream parameter is not at its start position.
Param<T>.Between(T, T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not between two values, both excluded.
Param<T>.BetweenOrEqualTo(T, T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not between two values, both included.
Param<T>.BitwiseEqualTo(T, string?)Throws an ArgumentException if the value of a parameter does not have the same bytes as a specified value.
Param<T>.CanRead(string?)Throws an ArgumentException if the value of a stream parameter does not support reading.
Param<T>.CanSeek(string?)Throws an ArgumentException if the value of a stream parameter does not support seeking.
Param<T>.CanWrite(string?)Throws an ArgumentException if the value of a stream parameter does not support writing.
Param<T>.Canceled(string?)Throws an ArgumentException if the value of a task parameter is not canceled.
Param<T>.Checked(Func<T, bool>, string?)Throws an ArgumentException if the value of a parameter does not satisfy a condition.
Param<double>.CloseTo(double, double, string?)Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.
Param<int>.CloseTo(int, uint, string?)Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.
Param<float>.CloseTo(float, float, string?)Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.
Param<long>.CloseTo(long, ulong, string?)Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.
Param<nint>.CloseTo(nint, nuint, string?)Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.
Param<T>.Completed(string?)Throws an ArgumentException if the value of a task parameter is not completed.
Param<T>.CompletedSuccessfully(string?)Throws an ArgumentException if the value of a task parameter is not completed successfully.
Param<T>.Default(string?)Throws an ArgumentException if the value of a parameter is not the default value of its type.
Param<IReadOnlyList<T>>.Empty(string?)Throws an ArgumentException if the value of a read-only list parameter is not empty.
Param<ReadOnlyMemory<T>>.Empty(string?)Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter is not empty.
Param<string>.Empty(string?)Throws an ArgumentException if the value of a string parameter is not empty.
Param<IReadOnlyCollection<T>>.Empty(string?)Throws an ArgumentException if the value of a read-only collection parameter is not empty.
Param<IList<T>>.Empty(string?)Throws an ArgumentException if the value of a list parameter is not empty.
Param<Memory<T>>.Empty(string?)Throws an ArgumentException if the value of a Memory<T> parameter is not empty.
Param<List<T>>.Empty(string?)Throws an ArgumentException if the value of a List<T> parameter is not empty.
Param<T[]>.Empty(string?)Throws an ArgumentException if the value of an array parameter is not empty.
Param<ICollection<T>>.Empty(string?)Throws an ArgumentException if the value of a collection parameter is not empty.
Param<T>.EqualTo(T, string?)Throws an ArgumentException if the value of a parameter is not equal to a specified value.
Param<bool>.False(TrueConditionInterpolatedStringHandler)Throws an ArgumentException if the value of a Boolean parameter is true, with an interpolated string as the message of the exception.
Param<bool>.False(string?)Throws an ArgumentException if the value of a Boolean parameter is true.
Param<T>.Faulted(string?)Throws an ArgumentException if the value of a task parameter is not faulted.
Param<T>.GreaterThan(T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not greater than a specified value.
Param<T>.GreaterThanOrEqualTo(T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is less than a specified value.
Param<IReadOnlyList<T>>.HasSizeEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a read-only list parameter does not have the same number of items as a specified collection.
Param<IReadOnlyList<T>>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a read-only list parameter does not have a specified number of items.
Param<ReadOnlyMemory<T>>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter does not have a specified length.
Param<ReadOnlyMemory<T>>.HasSizeEqualTo(ReadOnlyMemory<T>, string?)Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter does not have the same length as a specified ReadOnlyMemory<T>.
Param<string>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a string parameter does not have a specified length.
Param<string>.HasSizeEqualTo(string, string?)Throws an ArgumentException if the value of a string parameter does not have the same length as a specified string.
Param<IReadOnlyCollection<T>>.HasSizeEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a read-only collection parameter does not have the same number of items as a specified collection.
Param<IReadOnlyCollection<T>>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a read-only collection parameter does not have a specified number of items.
Param<IList<T>>.HasSizeEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a list parameter does not have the same number of items as a specified collection.
Param<IList<T>>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a list parameter does not have a specified number of items.
Param<Memory<T>>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a Memory<T> parameter does not have a specified length.
Param<Memory<T>>.HasSizeEqualTo(ReadOnlyMemory<T>, string?)Throws an ArgumentException if the value of a Memory<T> parameter does not have the same length as a specified ReadOnlyMemory<T>.
Param<List<T>>.HasSizeEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a List<T> parameter does not have the same number of items as a specified collection.
Param<List<T>>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a List<T> parameter does not have a specified number of items.
Param<T[]>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of an array parameter does not have a specified length.
Param<T[]>.HasSizeEqualTo(T[], string?)Throws an ArgumentException if the value of an array parameter does not have the same length as a specified array.
Param<ICollection<T>>.HasSizeEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a collection parameter does not have the same number of items as a specified collection.
Param<ICollection<T>>.HasSizeEqualTo(int, string?)Throws an ArgumentException if the value of a collection parameter does not have a specified number of items.
Param<IReadOnlyList<T>>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the number of items of the value of a read-only list parameter is not greater than a specified value.
Param<ReadOnlyMemory<T>>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is not greater than a specified value.
Param<string>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the length of the value of a string parameter is not greater than a specified value.
Param<IReadOnlyCollection<T>>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the number of items of the value of a read-only collection parameter is not greater than a specified value.
Param<IList<T>>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the number of items of the value of a list parameter is not greater than a specified value.
Param<Memory<T>>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the length of the value of a Memory<T> parameter is not greater than a specified value.
Param<List<T>>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the number of items of the value of a List<T> parameter is not greater than a specified value.
Param<T[]>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the length of the value of an array parameter is not greater than a specified value.
Param<ICollection<T>>.HasSizeGreaterThan(int, string?)Throws an ArgumentException if the number of items of the value of a collection parameter is not greater than a specified value.
Param<IReadOnlyList<T>>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a read-only list parameter is less than a specified value.
Param<ReadOnlyMemory<T>>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is less than a specified value.
Param<string>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of a string parameter is less than a specified value.
Param<IReadOnlyCollection<T>>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a read-only collection parameter is less than a specified value.
Param<IList<T>>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a list parameter is less than a specified value.
Param<Memory<T>>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of a Memory<T> parameter is less than a specified value.
Param<List<T>>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a List<T> parameter is less than a specified value.
Param<T[]>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of an array parameter is less than a specified value.
Param<ICollection<T>>.HasSizeGreaterThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a collection parameter is less than a specified value.
Param<IReadOnlyList<T>>.HasSizeLessThan(int, string?)Throws an ArgumentException if the number of items of the value of a read-only list parameter is not less than a specified value.
Param<ReadOnlyMemory<T>>.HasSizeLessThan(int, string?)Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is not less than a specified value.
Param<string>.HasSizeLessThan(int, string?)Throws an ArgumentException if the length of the value of a string parameter is not less than a specified value.
Param<IReadOnlyCollection<T>>.HasSizeLessThan(int, string?)Throws an ArgumentException if the number of items of the value of a read-only collection parameter is not less than a specified value.
Param<IList<T>>.HasSizeLessThan(int, string?)Throws an ArgumentException if the number of items of the value of a list parameter is not less than a specified value.
Param<Memory<T>>.HasSizeLessThan(int, string?)Throws an ArgumentException if the length of the value of a Memory<T> parameter is not less than a specified value.
Param<List<T>>.HasSizeLessThan(int, string?)Throws an ArgumentException if the number of items of the value of a List<T> parameter is not less than a specified value.
Param<T[]>.HasSizeLessThan(int, string?)Throws an ArgumentException if the length of the value of an array parameter is not less than a specified value.
Param<ICollection<T>>.HasSizeLessThan(int, string?)Throws an ArgumentException if the number of items of the value of a collection parameter is not less than a specified value.
Param<IReadOnlyList<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a read-only list parameter holds more items than a specified collection.
Param<IReadOnlyList<T>>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a read-only list parameter is greater than a specified value.
Param<ReadOnlyMemory<T>>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is greater than a specified value.
Param<ReadOnlyMemory<T>>.HasSizeLessThanOrEqualTo(ReadOnlyMemory<T>, string?)Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter is longer than a specified ReadOnlyMemory<T>.
Param<string>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of a string parameter is greater than a specified value.
Param<string>.HasSizeLessThanOrEqualTo(string, string?)Throws an ArgumentException if the value of a string parameter is longer than a specified string.
Param<IReadOnlyCollection<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a read-only collection parameter holds more items than a specified collection.
Param<IReadOnlyCollection<T>>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a read-only collection parameter is greater than a specified value.
Param<IList<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a list parameter holds more items than a specified collection.
Param<IList<T>>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a list parameter is greater than a specified value.
Param<Memory<T>>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of a Memory<T> parameter is greater than a specified value.
Param<Memory<T>>.HasSizeLessThanOrEqualTo(ReadOnlyMemory<T>, string?)Throws an ArgumentException if the value of a Memory<T> parameter is longer than a specified ReadOnlyMemory<T>.
Param<List<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a List<T> parameter holds more items than a specified collection.
Param<List<T>>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a List<T> parameter is greater than a specified value.
Param<T[]>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the length of the value of an array parameter is greater than a specified value.
Param<T[]>.HasSizeLessThanOrEqualTo(T[], string?)Throws an ArgumentException if the value of an array parameter is longer than a specified array.
Param<ICollection<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)Throws an ArgumentException if the value of a collection parameter holds more items than a specified collection.
Param<ICollection<T>>.HasSizeLessThanOrEqualTo(int, string?)Throws an ArgumentException if the number of items of the value of a collection parameter is greater than a specified value.
Param<IReadOnlyList<T>>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a read-only list parameter has a specified number of items.
Param<ReadOnlyMemory<T>>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter has a specified length.
Param<string>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a string parameter has a specified length.
Param<IReadOnlyCollection<T>>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a read-only collection parameter has a specified number of items.
Param<IList<T>>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a list parameter has a specified number of items.
Param<Memory<T>>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a Memory<T> parameter has a specified length.
Param<List<T>>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a List<T> parameter has a specified number of items.
Param<T[]>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of an array parameter has a specified length.
Param<ICollection<T>>.HasSizeNotEqualTo(int, string?)Throws an ArgumentException if the value of a collection parameter has a specified number of items.
Param<T>.HasStatusEqualTo(TaskStatus, string?)Throws an ArgumentException if the value of a task parameter does not have a specified status.
Param<T>.HasStatusNotEqualTo(TaskStatus, string?)Throws an ArgumentException if the value of a task parameter has a specified status.
Param<T>.InRange(T, T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is outside a range that includes its lower bound and excludes its upper bound.
Param<int>.InRangeFor(string, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of a character in a specified string.
Param<int>.InRangeFor<T>(ICollection<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified collection.
Param<int>.InRangeFor<T>(IReadOnlyCollection<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified read-only collection.
Param<int>.InRangeFor<T>(List<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified List<T>.
Param<int>.InRangeFor<T>(Memory<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified Memory<T>.
Param<int>.InRangeFor<T>(ReadOnlyMemory<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified ReadOnlyMemory<T>.
Param<int>.InRangeFor<T>(ReadOnlySpan<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified read-only span.
Param<int>.InRangeFor<T>(Span<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified span.
Param<int>.InRangeFor<T>(T[], string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified array.
Param<T>.LessThan(T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is not less than a specified value.
Param<T>.LessThanOrEqualTo(T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is greater than a specified value.
Param<object>.NotAssignableTo<TTarget>(string?)Throws an ArgumentException if the value of a parameter can be assigned to a specified type.
Param<T>.NotAssignableTo(Type, string?)Throws an ArgumentException if the value of a parameter can be assigned to a specified type.
Param<T>.NotBetween(T, T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is between two values, both excluded.
Param<T>.NotBetweenOrEqualTo(T, T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is between two values, both included.
Param<T>.NotCanceled(string?)Throws an ArgumentException if the value of a task parameter is canceled.
Param<double>.NotCloseTo(double, double, string?)Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.
Param<int>.NotCloseTo(int, uint, string?)Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.
Param<float>.NotCloseTo(float, float, string?)Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.
Param<long>.NotCloseTo(long, ulong, string?)Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.
Param<nint>.NotCloseTo(nint, nuint, string?)Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.
Param<T>.NotCompleted(string?)Throws an ArgumentException if the value of a task parameter is completed.
Param<T>.NotCompletedSuccessfully(string?)Throws an ArgumentException if the value of a task parameter is completed successfully.
Param<T>.NotDefault(string?)Throws an ArgumentException if the value of a parameter is the default value of its type.
Param<IReadOnlyList<T>>.NotEmpty(string?)Throws an ArgumentException if the value of a read-only list parameter is empty.
Param<ReadOnlyMemory<T>>.NotEmpty(string?)Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter is empty.
Param<string>.NotEmpty(string?)Throws an ArgumentException if the value of a string parameter is empty.
Param<IReadOnlyCollection<T>>.NotEmpty(string?)Throws an ArgumentException if the value of a read-only collection parameter is empty.
Param<IList<T>>.NotEmpty(string?)Throws an ArgumentException if the value of a list parameter is empty.
Param<Memory<T>>.NotEmpty(string?)Throws an ArgumentException if the value of a Memory<T> parameter is empty.
Param<List<T>>.NotEmpty(string?)Throws an ArgumentException if the value of a List<T> parameter is empty.
Param<T[]>.NotEmpty(string?)Throws an ArgumentException if the value of an array parameter is empty.
Param<ICollection<T>>.NotEmpty(string?)Throws an ArgumentException if the value of a collection parameter is empty.
Param<T>.NotEqualTo(T, string?)Throws an ArgumentException if the value of a parameter is equal to a specified value.
Param<T>.NotFaulted(string?)Throws an ArgumentException if the value of a task parameter is faulted.
Param<T>.NotInRange(T, T, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is inside a range that includes its lower bound and excludes its upper bound.
Param<int>.NotInRangeFor(string, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of a character in a specified string.
Param<int>.NotInRangeFor<T>(ICollection<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified collection.
Param<int>.NotInRangeFor<T>(IReadOnlyCollection<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified read-only collection.
Param<int>.NotInRangeFor<T>(List<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified List<T>.
Param<int>.NotInRangeFor<T>(Memory<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified Memory<T>.
Param<int>.NotInRangeFor<T>(ReadOnlyMemory<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified ReadOnlyMemory<T>.
Param<int>.NotInRangeFor<T>(ReadOnlySpan<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified read-only span.
Param<int>.NotInRangeFor<T>(Span<T>, string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified span.
Param<int>.NotInRangeFor<T>(T[], string?)Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified array.
Param<object>.NotOfType<TTarget>(string?)Throws an ArgumentException if the value of a parameter is of a specified type.
Param<T>.NotOfType(Type, string?)Throws an ArgumentException if the value of a parameter is of a specified type.
Param<string>.NotWhiteSpace(string?)Throws an ArgumentException if the value of a string parameter is empty, or consists only of white-space characters.
Param<T>.Null(string?)Throws an ArgumentException if the value of a parameter is not null.
Param<string?>.NullOrEmpty(string?)Throws an ArgumentException if the value of a string parameter is neither null nor empty.
Param<string?>.NullOrWhiteSpace(string?)Throws an ArgumentException if the value of a string parameter holds a character that is not a white-space character.
Param<object>.OfType<TTarget>(string?)Throws an ArgumentException if the value of a parameter is not of a specified type, and continues the chain with that type.
Param<T>.OfType(Type, string?)Throws an ArgumentException if the value of a parameter is not of a specified type.
Param<T>.ReferenceEqualTo(T, string?)Throws an ArgumentException if the value of a parameter is not a specified instance.
Param<T>.ReferenceNotEqualTo(T, string?)Throws an ArgumentException if the value of a parameter is a specified instance.
Param<bool>.True(FalseConditionInterpolatedStringHandler)Throws an ArgumentException if the value of a Boolean parameter is false, with an interpolated string as the message of the exception.
Param<bool>.True(string?)Throws an ArgumentException if the value of a Boolean parameter is false.
Param<string>.WhiteSpace(string?)Throws an ArgumentException if the value of a string parameter holds a character that is not a white-space character.

Param<object>.AssignableTo<TTarget>(string?)

Throws an ArgumentException if the value of a parameter cannot be assigned to a specified type, and continues the chain with that type.

extension(Param<object> @this)
{
    public Param<TTarget> AssignableTo<TTarget>(string? message = null) where TTarget : notnull
}

Type parameters

TTarget
The type that the value must be assignable to.

Parameters

this Param<object>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is TTarget.

Returns

Param<TTarget> A Param<T> that holds the value of this, as a TTarget, and its name.

Exceptions

ArgumentException
The value of this is not an instance of TTarget.

Param<T>.AssignableTo(Type, string?)

Throws an ArgumentException if the value of a parameter cannot be assigned to a specified type.

extension<T>(Param<T> @this) where T : notnull
{
    public Param<T> AssignableTo(Type type, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
type Type
The type that the value must be assignable to.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is type.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentNullException
type is null.
ArgumentException
The value of this is not an instance of type.

Param<T>.AtEndPosition(string?)

Throws an ArgumentException if the value of a stream parameter is not at its end position.

extension<T>(Param<T> @this) where T : Stream
{
    public Param<T> AtEndPosition(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the stream to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the position of the stream, and {3} is the length of the stream.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The Stream.Position property of the value of this is not equal to its Stream.Length property.
NotSupportedException
The value of this does not support seeking.
ObjectDisposedException
The value of this is closed.

Remarks

A stream that passes this check can be appended to without overwriting any of its data.

Some streams accept a position after their end. Such a position does not pass the check.

Param<T>.AtStartPosition(string?)

Throws an ArgumentException if the value of a stream parameter is not at its start position.

extension<T>(Param<T> @this) where T : Stream
{
    public Param<T> AtStartPosition(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the stream to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the position of the stream.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The Stream.Position property of the value of this is not zero.
NotSupportedException
The value of this does not support seeking.
ObjectDisposedException
The value of this is closed.

Param<T>.Between(T, T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not between two values, both excluded.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> Between(T minimum, T maximum, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
minimum T
The exclusive lower bound of the range.
maximum T
The exclusive upper bound of the range.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is minimum, and {3} is maximum.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is less than or equal to minimum. - or - The value of this is greater than or equal to maximum.

Param<T>.BetweenOrEqualTo(T, T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not between two values, both included.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> BetweenOrEqualTo(T minimum, T maximum, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
minimum T
The inclusive lower bound of the range.
maximum T
The inclusive upper bound of the range.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is minimum, and {3} is maximum.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is less than minimum. - or - The value of this is greater than maximum.

Param<T>.BitwiseEqualTo(T, string?)

Throws an ArgumentException if the value of a parameter does not have the same bytes as a specified value.

extension<T>(Param<T> @this) where T : unmanaged
{
    public Param<T> BitwiseEqualTo(T target, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
target T
The value to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is target.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this and target differ by at least one byte.

Remarks

The comparison covers every byte of the two values, the padding bytes of a structure included.

Param<T>.CanRead(string?)

Throws an ArgumentException if the value of a stream parameter does not support reading.

extension<T>(Param<T> @this) where T : Stream
{
    public Param<T> CanRead(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the stream to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The Stream.CanRead property of the value of this is false.

Param<T>.CanSeek(string?)

Throws an ArgumentException if the value of a stream parameter does not support seeking.

extension<T>(Param<T> @this) where T : Stream
{
    public Param<T> CanSeek(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the stream to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The Stream.CanSeek property of the value of this is false.

Param<T>.CanWrite(string?)

Throws an ArgumentException if the value of a stream parameter does not support writing.

extension<T>(Param<T> @this) where T : Stream
{
    public Param<T> CanWrite(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the stream to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The Stream.CanWrite property of the value of this is false.

Param<T>.Canceled(string?)

Throws an ArgumentException if the value of a task parameter is not canceled.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> Canceled(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is not TaskStatus.Canceled.

Param<T>.Checked(Func<T, bool>, string?)

Throws an ArgumentException if the value of a parameter does not satisfy a condition.

extension<T>(Param<T> @this)
{
    public Param<T> Checked(Func<T, bool> predicate, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
predicate Func<T, bool>
A function to test the value for a condition.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentNullException
predicate is null.
ArgumentException
predicate returns false for the value of this.

Param<double>.CloseTo(double, double, string?)

Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.

extension(Param<double> @this)
{
    public Param<double> CloseTo(double target, double delta, string? message = null)
}

Parameters

this Param<double>
The Param<T> that holds the value to check.
target double
The value to compare with.
delta double
The maximum distance between the value of the parameter and target.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<double> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is greater than delta. - or - The value of this, target, or delta is Double.NaN.

Param<int>.CloseTo(int, uint, string?)

Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.

extension(Param<int> @this)
{
    public Param<int> CloseTo(int target, uint delta, string? message = null)
}

Parameters

this Param<int>
The Param<T> that holds the index to check.
target int
The value to compare with.
delta uint
The maximum distance between the value of the parameter and target.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<int> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is greater than delta.

Param<float>.CloseTo(float, float, string?)

Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.

extension(Param<float> @this)
{
    public Param<float> CloseTo(float target, float delta, string? message = null)
}

Parameters

this Param<float>
The Param<T> that holds the value to check.
target float
The value to compare with.
delta float
The maximum distance between the value of the parameter and target.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<float> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is greater than delta. - or - The value of this, target, or delta is Single.NaN.

Param<long>.CloseTo(long, ulong, string?)

Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.

extension(Param<long> @this)
{
    public Param<long> CloseTo(long target, ulong delta, string? message = null)
}

Parameters

this Param<long>
The Param<T> that holds the value to check.
target long
The value to compare with.
delta ulong
The maximum distance between the value of the parameter and target.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<long> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is greater than delta.

Param<nint>.CloseTo(nint, nuint, string?)

Throws an ArgumentException if the value of a parameter is farther from a specified value than a specified distance.

net10.0, net11.0

extension(Param<nint> @this)
{
    public Param<nint> CloseTo(nint target, nuint delta, string? message = null)
}

net48, netstandard2.0

extension(Param<nint> @this)
{
    public Param<nint> CloseTo(nint target, nuint delta, string? message = null)
}

Parameters

this Param<nint>
The Param<T> that holds the value to check.
target nint
The value to compare with.
delta nuint
The maximum distance between the value of the parameter and target.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<nint> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is greater than delta.

Param<T>.Completed(string?)

Throws an ArgumentException if the value of a task parameter is not completed.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> Completed(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is not TaskStatus.RanToCompletion, TaskStatus.Faulted, or TaskStatus.Canceled.

Param<T>.CompletedSuccessfully(string?)

Throws an ArgumentException if the value of a task parameter is not completed successfully.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> CompletedSuccessfully(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is not TaskStatus.RanToCompletion.

Param<T>.Default(string?)

Throws an ArgumentException if the value of a parameter is not the default value of its type.

extension<T>(Param<T> @this) where T : struct, IEquatable<T>
{
    public Param<T> Default(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is not equal to the default value of T.

Param<IReadOnlyList<T>>.Empty(string?)

Throws an ArgumentException if the value of a read-only list parameter is not empty.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> Empty(string? message = null)
}

Type parameters

T
The type of the items of the read-only list.

Parameters

this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of the value.

Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<ReadOnlyMemory<T>>.Empty(string?)

Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter is not empty.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> Empty(string? message = null)
}

Type parameters

T
The type of the items of the ReadOnlyMemory<T>.

Parameters

this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of the value.

Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<string>.Empty(string?)

Throws an ArgumentException if the value of a string parameter is not empty.

extension(Param<string> @this)
{
    public Param<string> Empty(string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one character.

Param<IReadOnlyCollection<T>>.Empty(string?)

Throws an ArgumentException if the value of a read-only collection parameter is not empty.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> Empty(string? message = null)
}

Type parameters

T
The type of the items of the read-only collection.

Parameters

this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of the value.

Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<IList<T>>.Empty(string?)

Throws an ArgumentException if the value of a list parameter is not empty.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> Empty(string? message = null)
}

Type parameters

T
The type of the items of the list.

Parameters

this Param<IList<T>>
The Param<T> that holds the list to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of the value.

Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<Memory<T>>.Empty(string?)

Throws an ArgumentException if the value of a Memory<T> parameter is not empty.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> Empty(string? message = null)
}

Type parameters

T
The type of the items of the Memory<T>.

Parameters

this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of the value.

Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<List<T>>.Empty(string?)

Throws an ArgumentException if the value of a List<T> parameter is not empty.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> Empty(string? message = null)
}

Type parameters

T
The type of the items of the List<T>.

Parameters

this Param<List<T>>
The Param<T> that holds the List<T> to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of the value.

Returns

Param<List<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<T[]>.Empty(string?)

Throws an ArgumentException if the value of an array parameter is not empty.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> Empty(string? message = null)
}

Type parameters

T
The type of the items of the array.

Parameters

this Param<T[]>
The Param<T> that holds the array to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of the value.

Returns

Param<T[]> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<ICollection<T>>.Empty(string?)

Throws an ArgumentException if the value of a collection parameter is not empty.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> Empty(string? message = null)
}

Type parameters

T
The type of the items of the collection.

Parameters

this Param<ICollection<T>>
The Param<T> that holds the collection to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of the value.

Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one item.

Param<T>.EqualTo(T, string?)

Throws an ArgumentException if the value of a parameter is not equal to a specified value.

extension<T>(Param<T> @this) where T : IEquatable<T>
{
    public Param<T> EqualTo(T target, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
target T
The value to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is target.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is not equal to target.

Param<bool>.False overloads

Param<bool>.False(TrueConditionInterpolatedStringHandler)

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Throws an ArgumentException if the value of a Boolean parameter is true, with an interpolated string as the message of the exception.

extension(Param<bool> @this)
{
    public Param<bool> False(ref TrueConditionInterpolatedStringHandler message)
}
Parameters
this Param<bool>
The Param<T> that holds the value to check.
message TrueConditionInterpolatedStringHandler
The interpolated string to use as the message of the exception. It is formatted only if the check fails, and it is not processed as a composite format string.
Returns

Param<bool> this, for the next check of the chain.

Exceptions
ArgumentException
The value of this is true.
Remarks

This method is not available in the netstandard and .NET Framework builds of Louis, because their BCL has no StringBuilder.AppendInterpolatedStringHandler.

Param<bool>.False(string?)

Throws an ArgumentException if the value of a Boolean parameter is true.

extension(Param<bool> @this)
{
    public Param<bool> False(string? message = null)
}
Parameters
this Param<bool>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.
Returns

Param<bool> this, for the next check of the chain.

Exceptions
ArgumentException
The value of this is true.

Param<T>.Faulted(string?)

Throws an ArgumentException if the value of a task parameter is not faulted.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> Faulted(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is not TaskStatus.Faulted.

Param<T>.GreaterThan(T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not greater than a specified value.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> GreaterThan(T threshold, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
threshold T
The value to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is threshold.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is less than or equal to threshold.

Param<T>.GreaterThanOrEqualTo(T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is less than a specified value.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> GreaterThanOrEqualTo(T threshold, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
threshold T
The value to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is threshold.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is less than threshold.

Param<IReadOnlyList<T>>.HasSizeEqualTo overloads

Param<IReadOnlyList<T>>.HasSizeEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a read-only list parameter does not have the same number of items as a specified collection.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the read-only list.
Parameters
this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
other ICollection<T>
The collection whose number of items the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is not equal to the number of items of other.

Param<IReadOnlyList<T>>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a read-only list parameter does not have a specified number of items.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the read-only list.
Parameters
this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
size int
The number of items that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is not equal to size.

Param<ReadOnlyMemory<T>>.HasSizeEqualTo overloads

Param<ReadOnlyMemory<T>>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter does not have a specified length.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the ReadOnlyMemory<T>.
Parameters
this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
size int
The length that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is not equal to size.

Param<ReadOnlyMemory<T>>.HasSizeEqualTo(ReadOnlyMemory<T>, string?)

Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter does not have the same length as a specified ReadOnlyMemory<T>.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeEqualTo(ReadOnlyMemory<T> other, string? message = null)
}
Type parameters
T
The type of the items of the ReadOnlyMemory<T>.
Parameters
this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
other ReadOnlyMemory<T>
The ReadOnlyMemory<T> whose length the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is not equal to the length of other.

Param<string>.HasSizeEqualTo overloads

Param<string>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a string parameter does not have a specified length.

extension(Param<string> @this)
{
    public Param<string> HasSizeEqualTo(int size, string? message = null)
}
Parameters
this Param<string>
The Param<T> that holds the string to check.
size int
The length that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<string> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is not equal to size.

Param<string>.HasSizeEqualTo(string, string?)

Throws an ArgumentException if the value of a string parameter does not have the same length as a specified string.

extension(Param<string> @this)
{
    public Param<string> HasSizeEqualTo(string other, string? message = null)
}
Parameters
this Param<string>
The Param<T> that holds the string to check.
other string
The string whose length the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<string> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The length of the value of this is not equal to the length of other.

Param<IReadOnlyCollection<T>>.HasSizeEqualTo overloads

Param<IReadOnlyCollection<T>>.HasSizeEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a read-only collection parameter does not have the same number of items as a specified collection.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the read-only collection.
Parameters
this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
other ICollection<T>
The collection whose number of items the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is not equal to the number of items of other.

Param<IReadOnlyCollection<T>>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a read-only collection parameter does not have a specified number of items.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the read-only collection.
Parameters
this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
size int
The number of items that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is not equal to size.

Param<IList<T>>.HasSizeEqualTo overloads

Param<IList<T>>.HasSizeEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a list parameter does not have the same number of items as a specified collection.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the list.
Parameters
this Param<IList<T>>
The Param<T> that holds the list to check.
other ICollection<T>
The collection whose number of items the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is not equal to the number of items of other.

Param<IList<T>>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a list parameter does not have a specified number of items.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the list.
Parameters
this Param<IList<T>>
The Param<T> that holds the list to check.
size int
The number of items that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is not equal to size.

Param<Memory<T>>.HasSizeEqualTo overloads

Param<Memory<T>>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a Memory<T> parameter does not have a specified length.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the Memory<T>.
Parameters
this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
size int
The length that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is not equal to size.

Param<Memory<T>>.HasSizeEqualTo(ReadOnlyMemory<T>, string?)

Throws an ArgumentException if the value of a Memory<T> parameter does not have the same length as a specified ReadOnlyMemory<T>.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeEqualTo(ReadOnlyMemory<T> other, string? message = null)
}
Type parameters
T
The type of the items of the Memory<T>.
Parameters
this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
other ReadOnlyMemory<T>
The ReadOnlyMemory<T> whose length the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is not equal to the length of other.

Param<List<T>>.HasSizeEqualTo overloads

Param<List<T>>.HasSizeEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a List<T> parameter does not have the same number of items as a specified collection.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the List<T>.
Parameters
this Param<List<T>>
The Param<T> that holds the List<T> to check.
other ICollection<T>
The collection whose number of items the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<List<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is not equal to the number of items of other.

Param<List<T>>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a List<T> parameter does not have a specified number of items.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the List<T>.
Parameters
this Param<List<T>>
The Param<T> that holds the List<T> to check.
size int
The number of items that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<List<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is not equal to size.

Param<T[]>.HasSizeEqualTo overloads

Param<T[]>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of an array parameter does not have a specified length.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the array.
Parameters
this Param<T[]>
The Param<T> that holds the array to check.
size int
The length that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<T[]> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is not equal to size.

Param<T[]>.HasSizeEqualTo(T[], string?)

Throws an ArgumentException if the value of an array parameter does not have the same length as a specified array.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeEqualTo(T[] other, string? message = null)
}
Type parameters
T
The type of the items of the array.
Parameters
this Param<T[]>
The Param<T> that holds the array to check.
other T[]
The array whose length the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<T[]> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The length of the value of this is not equal to the length of other.

Param<ICollection<T>>.HasSizeEqualTo overloads

Param<ICollection<T>>.HasSizeEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a collection parameter does not have the same number of items as a specified collection.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the collection.
Parameters
this Param<ICollection<T>>
The Param<T> that holds the collection to check.
other ICollection<T>
The collection whose number of items the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is not equal to the number of items of other.

Param<ICollection<T>>.HasSizeEqualTo(int, string?)

Throws an ArgumentException if the value of a collection parameter does not have a specified number of items.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the collection.
Parameters
this Param<ICollection<T>>
The Param<T> that holds the collection to check.
size int
The number of items that the value must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is not equal to size.

Param<IReadOnlyList<T>>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only list parameter is not greater than a specified value.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only list.

Parameters

this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than or equal to size.

Param<ReadOnlyMemory<T>>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is not greater than a specified value.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the ReadOnlyMemory<T>.

Parameters

this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than or equal to size.

Param<string>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the length of the value of a string parameter is not greater than a specified value.

extension(Param<string> @this)
{
    public Param<string> HasSizeGreaterThan(int size, string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than or equal to size.

Param<IReadOnlyCollection<T>>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only collection parameter is not greater than a specified value.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only collection.

Parameters

this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than or equal to size.

Param<IList<T>>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the number of items of the value of a list parameter is not greater than a specified value.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the list.

Parameters

this Param<IList<T>>
The Param<T> that holds the list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than or equal to size.

Param<Memory<T>>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the length of the value of a Memory<T> parameter is not greater than a specified value.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the Memory<T>.

Parameters

this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than or equal to size.

Param<List<T>>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the number of items of the value of a List<T> parameter is not greater than a specified value.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the List<T>.

Parameters

this Param<List<T>>
The Param<T> that holds the List<T> to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<List<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than or equal to size.

Param<T[]>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the length of the value of an array parameter is not greater than a specified value.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the array.

Parameters

this Param<T[]>
The Param<T> that holds the array to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<T[]> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than or equal to size.

Param<ICollection<T>>.HasSizeGreaterThan(int, string?)

Throws an ArgumentException if the number of items of the value of a collection parameter is not greater than a specified value.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeGreaterThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the collection.

Parameters

this Param<ICollection<T>>
The Param<T> that holds the collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than or equal to size.

Param<IReadOnlyList<T>>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only list parameter is less than a specified value.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only list.

Parameters

this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than size.

Param<ReadOnlyMemory<T>>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is less than a specified value.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the ReadOnlyMemory<T>.

Parameters

this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than size.

Param<string>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of a string parameter is less than a specified value.

extension(Param<string> @this)
{
    public Param<string> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than size.

Param<IReadOnlyCollection<T>>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only collection parameter is less than a specified value.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only collection.

Parameters

this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than size.

Param<IList<T>>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a list parameter is less than a specified value.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the list.

Parameters

this Param<IList<T>>
The Param<T> that holds the list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than size.

Param<Memory<T>>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of a Memory<T> parameter is less than a specified value.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the Memory<T>.

Parameters

this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than size.

Param<List<T>>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a List<T> parameter is less than a specified value.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the List<T>.

Parameters

this Param<List<T>>
The Param<T> that holds the List<T> to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<List<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than size.

Param<T[]>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of an array parameter is less than a specified value.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the array.

Parameters

this Param<T[]>
The Param<T> that holds the array to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<T[]> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is less than size.

Param<ICollection<T>>.HasSizeGreaterThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a collection parameter is less than a specified value.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeGreaterThanOrEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the collection.

Parameters

this Param<ICollection<T>>
The Param<T> that holds the collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is less than size.

Param<IReadOnlyList<T>>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only list parameter is not less than a specified value.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only list.

Parameters

this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is greater than or equal to size.

Param<ReadOnlyMemory<T>>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is not less than a specified value.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the ReadOnlyMemory<T>.

Parameters

this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is greater than or equal to size.

Param<string>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the length of the value of a string parameter is not less than a specified value.

extension(Param<string> @this)
{
    public Param<string> HasSizeLessThan(int size, string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is greater than or equal to size.

Param<IReadOnlyCollection<T>>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only collection parameter is not less than a specified value.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only collection.

Parameters

this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is greater than or equal to size.

Param<IList<T>>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the number of items of the value of a list parameter is not less than a specified value.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the list.

Parameters

this Param<IList<T>>
The Param<T> that holds the list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is greater than or equal to size.

Param<Memory<T>>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the length of the value of a Memory<T> parameter is not less than a specified value.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the Memory<T>.

Parameters

this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is greater than or equal to size.

Param<List<T>>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the number of items of the value of a List<T> parameter is not less than a specified value.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the List<T>.

Parameters

this Param<List<T>>
The Param<T> that holds the List<T> to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<List<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is greater than or equal to size.

Param<T[]>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the length of the value of an array parameter is not less than a specified value.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the array.

Parameters

this Param<T[]>
The Param<T> that holds the array to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<T[]> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is greater than or equal to size.

Param<ICollection<T>>.HasSizeLessThan(int, string?)

Throws an ArgumentException if the number of items of the value of a collection parameter is not less than a specified value.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeLessThan(int size, string? message = null)
}

Type parameters

T
The type of the items of the collection.

Parameters

this Param<ICollection<T>>
The Param<T> that holds the collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is greater than or equal to size.

Param<IReadOnlyList<T>>.HasSizeLessThanOrEqualTo overloads

Param<IReadOnlyList<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a read-only list parameter holds more items than a specified collection.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeLessThanOrEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the read-only list.
Parameters
this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
other ICollection<T>
The collection whose number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is greater than the number of items of other.

Param<IReadOnlyList<T>>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only list parameter is greater than a specified value.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the read-only list.
Parameters
this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is greater than size.

Param<ReadOnlyMemory<T>>.HasSizeLessThanOrEqualTo overloads

Param<ReadOnlyMemory<T>>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of a ReadOnlyMemory<T> parameter is greater than a specified value.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the ReadOnlyMemory<T>.
Parameters
this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is greater than size.

Param<ReadOnlyMemory<T>>.HasSizeLessThanOrEqualTo(ReadOnlyMemory<T>, string?)

Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter is longer than a specified ReadOnlyMemory<T>.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeLessThanOrEqualTo(ReadOnlyMemory<T> other, string? message = null)
}
Type parameters
T
The type of the items of the ReadOnlyMemory<T>.
Parameters
this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
other ReadOnlyMemory<T>
The ReadOnlyMemory<T> whose length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is greater than the length of other.

Param<string>.HasSizeLessThanOrEqualTo overloads

Param<string>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of a string parameter is greater than a specified value.

extension(Param<string> @this)
{
    public Param<string> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Parameters
this Param<string>
The Param<T> that holds the string to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<string> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is greater than size.

Param<string>.HasSizeLessThanOrEqualTo(string, string?)

Throws an ArgumentException if the value of a string parameter is longer than a specified string.

extension(Param<string> @this)
{
    public Param<string> HasSizeLessThanOrEqualTo(string other, string? message = null)
}
Parameters
this Param<string>
The Param<T> that holds the string to check.
other string
The string whose length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<string> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The length of the value of this is greater than the length of other.

Param<IReadOnlyCollection<T>>.HasSizeLessThanOrEqualTo overloads

Param<IReadOnlyCollection<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a read-only collection parameter holds more items than a specified collection.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeLessThanOrEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the read-only collection.
Parameters
this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
other ICollection<T>
The collection whose number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is greater than the number of items of other.

Param<IReadOnlyCollection<T>>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a read-only collection parameter is greater than a specified value.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the read-only collection.
Parameters
this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is greater than size.

Param<IList<T>>.HasSizeLessThanOrEqualTo overloads

Param<IList<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a list parameter holds more items than a specified collection.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeLessThanOrEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the list.
Parameters
this Param<IList<T>>
The Param<T> that holds the list to check.
other ICollection<T>
The collection whose number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is greater than the number of items of other.

Param<IList<T>>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a list parameter is greater than a specified value.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the list.
Parameters
this Param<IList<T>>
The Param<T> that holds the list to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is greater than size.

Param<Memory<T>>.HasSizeLessThanOrEqualTo overloads

Param<Memory<T>>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of a Memory<T> parameter is greater than a specified value.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the Memory<T>.
Parameters
this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is greater than size.

Param<Memory<T>>.HasSizeLessThanOrEqualTo(ReadOnlyMemory<T>, string?)

Throws an ArgumentException if the value of a Memory<T> parameter is longer than a specified ReadOnlyMemory<T>.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeLessThanOrEqualTo(ReadOnlyMemory<T> other, string? message = null)
}
Type parameters
T
The type of the items of the Memory<T>.
Parameters
this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
other ReadOnlyMemory<T>
The ReadOnlyMemory<T> whose length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is greater than the length of other.

Param<List<T>>.HasSizeLessThanOrEqualTo overloads

Param<List<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a List<T> parameter holds more items than a specified collection.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeLessThanOrEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the List<T>.
Parameters
this Param<List<T>>
The Param<T> that holds the List<T> to check.
other ICollection<T>
The collection whose number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<List<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is greater than the number of items of other.

Param<List<T>>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a List<T> parameter is greater than a specified value.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the List<T>.
Parameters
this Param<List<T>>
The Param<T> that holds the List<T> to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<List<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is greater than size.

Param<T[]>.HasSizeLessThanOrEqualTo overloads

Param<T[]>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the length of the value of an array parameter is greater than a specified value.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the array.
Parameters
this Param<T[]>
The Param<T> that holds the array to check.
size int
The length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.
Returns

Param<T[]> this, for the next check of the chain.

Exceptions
ArgumentException
The length of the value of this is greater than size.

Param<T[]>.HasSizeLessThanOrEqualTo(T[], string?)

Throws an ArgumentException if the value of an array parameter is longer than a specified array.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeLessThanOrEqualTo(T[] other, string? message = null)
}
Type parameters
T
The type of the items of the array.
Parameters
this Param<T[]>
The Param<T> that holds the array to check.
other T[]
The array whose length to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the length of other, and {3} is the length of the value.
Returns

Param<T[]> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The length of the value of this is greater than the length of other.

Param<ICollection<T>>.HasSizeLessThanOrEqualTo overloads

Param<ICollection<T>>.HasSizeLessThanOrEqualTo(ICollection<T>, string?)

Throws an ArgumentException if the value of a collection parameter holds more items than a specified collection.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeLessThanOrEqualTo(ICollection<T> other, string? message = null)
}
Type parameters
T
The type of the items of the collection.
Parameters
this Param<ICollection<T>>
The Param<T> that holds the collection to check.
other ICollection<T>
The collection whose number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is the number of items of other, and {3} is the number of items of the value.
Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions
ArgumentNullException
other is null.
ArgumentException
The number of items of the value of this is greater than the number of items of other.

Param<ICollection<T>>.HasSizeLessThanOrEqualTo(int, string?)

Throws an ArgumentException if the number of items of the value of a collection parameter is greater than a specified value.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeLessThanOrEqualTo(int size, string? message = null)
}
Type parameters
T
The type of the items of the collection.
Parameters
this Param<ICollection<T>>
The Param<T> that holds the collection to check.
size int
The number of items to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.
Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions
ArgumentException
The number of items of the value of this is greater than size.

Param<IReadOnlyList<T>>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a read-only list parameter has a specified number of items.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only list.

Parameters

this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
size int
The number of items that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is equal to size.

Param<ReadOnlyMemory<T>>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter has a specified length.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the ReadOnlyMemory<T>.

Parameters

this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
size int
The length that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is equal to size.

Param<string>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a string parameter has a specified length.

extension(Param<string> @this)
{
    public Param<string> HasSizeNotEqualTo(int size, string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
size int
The length that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is equal to size.

Param<IReadOnlyCollection<T>>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a read-only collection parameter has a specified number of items.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the read-only collection.

Parameters

this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
size int
The number of items that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is equal to size.

Param<IList<T>>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a list parameter has a specified number of items.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the list.

Parameters

this Param<IList<T>>
The Param<T> that holds the list to check.
size int
The number of items that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is equal to size.

Param<Memory<T>>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a Memory<T> parameter has a specified length.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the Memory<T>.

Parameters

this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
size int
The length that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is equal to size.

Param<List<T>>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a List<T> parameter has a specified number of items.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the List<T>.

Parameters

this Param<List<T>>
The Param<T> that holds the List<T> to check.
size int
The number of items that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<List<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is equal to size.

Param<T[]>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of an array parameter has a specified length.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the array.

Parameters

this Param<T[]>
The Param<T> that holds the array to check.
size int
The length that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the length of the value.

Returns

Param<T[]> this, for the next check of the chain.

Exceptions

ArgumentException
The length of the value of this is equal to size.

Param<ICollection<T>>.HasSizeNotEqualTo(int, string?)

Throws an ArgumentException if the value of a collection parameter has a specified number of items.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> HasSizeNotEqualTo(int size, string? message = null)
}

Type parameters

T
The type of the items of the collection.

Parameters

this Param<ICollection<T>>
The Param<T> that holds the collection to check.
size int
The number of items that the value must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is size, and {3} is the number of items of the value.

Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The number of items of the value of this is equal to size.

Param<T>.HasStatusEqualTo(TaskStatus, string?)

Throws an ArgumentException if the value of a task parameter does not have a specified status.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> HasStatusEqualTo(TaskStatus status, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
status TaskStatus
The status that the task must have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is status, and {3} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is not status.

Param<T>.HasStatusNotEqualTo(TaskStatus, string?)

Throws an ArgumentException if the value of a task parameter has a specified status.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> HasStatusNotEqualTo(TaskStatus status, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
status TaskStatus
The status that the task must not have.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is status, and {3} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is status.

Param<T>.InRange(T, T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is outside a range that includes its lower bound and excludes its upper bound.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> InRange(T minimum, T maximum, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
minimum T
The inclusive lower bound of the range.
maximum T
The exclusive upper bound of the range.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is minimum, and {3} is maximum.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is less than minimum. - or - The value of this is greater than or equal to maximum.

Param<int>.InRangeFor overloads

Param<int>.InRangeFor(string, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of a character in a specified string.

extension(Param<int> @this)
{
    public Param<int> InRangeFor(string text, string? message = null)
}
Parameters
this Param<int>
The Param<T> that holds the index to check.
text string
The string that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of text.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
text is null.
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the length of text.

Param<int>.InRangeFor<T>(ICollection<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified collection.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(ICollection<T> collection, string? message = null)
}
Type parameters
T
The type of the items of collection.
Parameters
this Param<int>
The Param<T> that holds the index to check.
collection ICollection<T>
The collection that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of collection.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
collection is null.
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the number of items of collection.

Param<int>.InRangeFor<T>(IReadOnlyCollection<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified read-only collection.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(IReadOnlyCollection<T> collection, string? message = null)
}
Type parameters
T
The type of the items of collection.
Parameters
this Param<int>
The Param<T> that holds the index to check.
collection IReadOnlyCollection<T>
The read-only collection that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of collection.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
collection is null.
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the number of items of collection.

Param<int>.InRangeFor<T>(List<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified List<T>.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(List<T> list, string? message = null)
}
Type parameters
T
The type of the items of list.
Parameters
this Param<int>
The Param<T> that holds the index to check.
list List<T>
The List<T> that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of list.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
list is null.
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the number of items of list.

Param<int>.InRangeFor<T>(Memory<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified Memory<T>.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(Memory<T> memory, string? message = null)
}
Type parameters
T
The type of the items of memory.
Parameters
this Param<int>
The Param<T> that holds the index to check.
memory Memory<T>
The Memory<T> that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of memory.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the length of memory.

Param<int>.InRangeFor<T>(ReadOnlyMemory<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified ReadOnlyMemory<T>.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(ReadOnlyMemory<T> memory, string? message = null)
}
Type parameters
T
The type of the items of memory.
Parameters
this Param<int>
The Param<T> that holds the index to check.
memory ReadOnlyMemory<T>
The ReadOnlyMemory<T> that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of memory.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the length of memory.

Param<int>.InRangeFor<T>(ReadOnlySpan<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified read-only span.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(ReadOnlySpan<T> span, string? message = null)
}
Type parameters
T
The type of the items of span.
Parameters
this Param<int>
The Param<T> that holds the index to check.
span ReadOnlySpan<T>
The read-only span that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of span.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the length of span.

Param<int>.InRangeFor<T>(Span<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified span.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(Span<T> span, string? message = null)
}
Type parameters
T
The type of the items of span.
Parameters
this Param<int>
The Param<T> that holds the index to check.
span Span<T>
The span that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of span.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the length of span.

Param<int>.InRangeFor<T>(T[], string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not the index of an item in a specified array.

extension(Param<int> @this)
{
    public Param<int> InRangeFor<T>(T[] array, string? message = null)
}
Type parameters
T
The type of the items of array.
Parameters
this Param<int>
The Param<T> that holds the index to check.
array T[]
The array that the value must be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of array.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
array is null.
ArgumentOutOfRangeException
The value of this is less than zero. - or - The value of this is greater than or equal to the length of array.

Param<T>.LessThan(T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is not less than a specified value.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> LessThan(T threshold, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
threshold T
The value to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is threshold.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is greater than or equal to threshold.

Param<T>.LessThanOrEqualTo(T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is greater than a specified value.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> LessThanOrEqualTo(T threshold, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
threshold T
The value to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is threshold.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is greater than threshold.

Param<object>.NotAssignableTo<TTarget>(string?)

Throws an ArgumentException if the value of a parameter can be assigned to a specified type.

extension(Param<object> @this)
{
    public Param<object> NotAssignableTo<TTarget>(string? message = null) where TTarget : notnull
}

Type parameters

TTarget
The type that the value must not be assignable to.

Parameters

this Param<object>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is TTarget.

Returns

Param<object> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is an instance of TTarget.

Param<T>.NotAssignableTo(Type, string?)

Throws an ArgumentException if the value of a parameter can be assigned to a specified type.

extension<T>(Param<T> @this) where T : notnull
{
    public Param<T> NotAssignableTo(Type type, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
type Type
The type that the value must not be assignable to.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is type.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentNullException
type is null.
ArgumentException
The value of this is an instance of type.

Param<T>.NotBetween(T, T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is between two values, both excluded.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> NotBetween(T minimum, T maximum, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
minimum T
The exclusive lower bound of the range.
maximum T
The exclusive upper bound of the range.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is minimum, and {3} is maximum.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is greater than minimum, and less than maximum.

Param<T>.NotBetweenOrEqualTo(T, T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is between two values, both included.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> NotBetweenOrEqualTo(T minimum, T maximum, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
minimum T
The inclusive lower bound of the range.
maximum T
The inclusive upper bound of the range.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is minimum, and {3} is maximum.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is greater than or equal to minimum, and less than or equal to maximum.

Param<T>.NotCanceled(string?)

Throws an ArgumentException if the value of a task parameter is canceled.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> NotCanceled(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is TaskStatus.Canceled.

Param<double>.NotCloseTo(double, double, string?)

Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.

extension(Param<double> @this)
{
    public Param<double> NotCloseTo(double target, double delta, string? message = null)
}

Parameters

this Param<double>
The Param<T> that holds the value to check.
target double
The value to compare with.
delta double
The distance between the value of the parameter and target that the value must exceed.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<double> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is less than or equal to delta. - or - The value of this, target, or delta is Double.NaN.

Param<int>.NotCloseTo(int, uint, string?)

Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.

extension(Param<int> @this)
{
    public Param<int> NotCloseTo(int target, uint delta, string? message = null)
}

Parameters

this Param<int>
The Param<T> that holds the index to check.
target int
The value to compare with.
delta uint
The distance between the value of the parameter and target that the value must exceed.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<int> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is less than or equal to delta.

Param<float>.NotCloseTo(float, float, string?)

Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.

extension(Param<float> @this)
{
    public Param<float> NotCloseTo(float target, float delta, string? message = null)
}

Parameters

this Param<float>
The Param<T> that holds the value to check.
target float
The value to compare with.
delta float
The distance between the value of the parameter and target that the value must exceed.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<float> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is less than or equal to delta. - or - The value of this, target, or delta is Single.NaN.

Param<long>.NotCloseTo(long, ulong, string?)

Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.

extension(Param<long> @this)
{
    public Param<long> NotCloseTo(long target, ulong delta, string? message = null)
}

Parameters

this Param<long>
The Param<T> that holds the value to check.
target long
The value to compare with.
delta ulong
The distance between the value of the parameter and target that the value must exceed.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<long> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is less than or equal to delta.

Param<nint>.NotCloseTo(nint, nuint, string?)

Throws an ArgumentException if the value of a parameter is within a specified distance of a specified value.

net10.0, net11.0

extension(Param<nint> @this)
{
    public Param<nint> NotCloseTo(nint target, nuint delta, string? message = null)
}

net48, netstandard2.0

extension(Param<nint> @this)
{
    public Param<nint> NotCloseTo(nint target, nuint delta, string? message = null)
}

Parameters

this Param<nint>
The Param<T> that holds the value to check.
target nint
The value to compare with.
delta nuint
The distance between the value of the parameter and target that the value must exceed.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is target, and {3} is delta.

Returns

Param<nint> this, for the next check of the chain.

Exceptions

ArgumentException
The distance between the value of this and target is less than or equal to delta.

Param<T>.NotCompleted(string?)

Throws an ArgumentException if the value of a task parameter is completed.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> NotCompleted(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is TaskStatus.RanToCompletion, TaskStatus.Faulted, or TaskStatus.Canceled.

Param<T>.NotCompletedSuccessfully(string?)

Throws an ArgumentException if the value of a task parameter is completed successfully.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> NotCompletedSuccessfully(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is TaskStatus.RanToCompletion.

Param<T>.NotDefault(string?)

Throws an ArgumentException if the value of a parameter is the default value of its type.

extension<T>(Param<T> @this) where T : struct, IEquatable<T>
{
    public Param<T> NotDefault(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is equal to the default value of T.

Param<IReadOnlyList<T>>.NotEmpty(string?)

Throws an ArgumentException if the value of a read-only list parameter is empty.

extension<T>(Param<IReadOnlyList<T>> @this)
{
    public Param<IReadOnlyList<T>> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the read-only list.

Parameters

this Param<IReadOnlyList<T>>
The Param<T> that holds the read-only list to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<IReadOnlyList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<ReadOnlyMemory<T>>.NotEmpty(string?)

Throws an ArgumentException if the value of a ReadOnlyMemory<T> parameter is empty.

extension<T>(Param<ReadOnlyMemory<T>> @this)
{
    public Param<ReadOnlyMemory<T>> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the ReadOnlyMemory<T>.

Parameters

this Param<ReadOnlyMemory<T>>
The Param<T> that holds the ReadOnlyMemory<T> to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<ReadOnlyMemory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<string>.NotEmpty(string?)

Throws an ArgumentException if the value of a string parameter is empty.

extension(Param<string> @this)
{
    public Param<string> NotEmpty(string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is the empty string.

Param<IReadOnlyCollection<T>>.NotEmpty(string?)

Throws an ArgumentException if the value of a read-only collection parameter is empty.

extension<T>(Param<IReadOnlyCollection<T>> @this)
{
    public Param<IReadOnlyCollection<T>> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the read-only collection.

Parameters

this Param<IReadOnlyCollection<T>>
The Param<T> that holds the read-only collection to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<IReadOnlyCollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<IList<T>>.NotEmpty(string?)

Throws an ArgumentException if the value of a list parameter is empty.

extension<T>(Param<IList<T>> @this)
{
    public Param<IList<T>> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the list.

Parameters

this Param<IList<T>>
The Param<T> that holds the list to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<IList<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<Memory<T>>.NotEmpty(string?)

Throws an ArgumentException if the value of a Memory<T> parameter is empty.

extension<T>(Param<Memory<T>> @this)
{
    public Param<Memory<T>> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the Memory<T>.

Parameters

this Param<Memory<T>>
The Param<T> that holds the Memory<T> to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<Memory<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<List<T>>.NotEmpty(string?)

Throws an ArgumentException if the value of a List<T> parameter is empty.

extension<T>(Param<List<T>> @this)
{
    public Param<List<T>> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the List<T>.

Parameters

this Param<List<T>>
The Param<T> that holds the List<T> to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<List<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<T[]>.NotEmpty(string?)

Throws an ArgumentException if the value of an array parameter is empty.

extension<T>(Param<T[]> @this)
{
    public Param<T[]> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the array.

Parameters

this Param<T[]>
The Param<T> that holds the array to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T[]> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<ICollection<T>>.NotEmpty(string?)

Throws an ArgumentException if the value of a collection parameter is empty.

extension<T>(Param<ICollection<T>> @this)
{
    public Param<ICollection<T>> NotEmpty(string? message = null)
}

Type parameters

T
The type of the items of the collection.

Parameters

this Param<ICollection<T>>
The Param<T> that holds the collection to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<ICollection<T>> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds no item.

Param<T>.NotEqualTo(T, string?)

Throws an ArgumentException if the value of a parameter is equal to a specified value.

extension<T>(Param<T> @this) where T : IEquatable<T>
{
    public Param<T> NotEqualTo(T target, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
target T
The value to compare with.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is target.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is equal to target.

Param<T>.NotFaulted(string?)

Throws an ArgumentException if the value of a task parameter is faulted.

extension<T>(Param<T> @this) where T : Task
{
    public Param<T> NotFaulted(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the task to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the status of the task.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The status of the value of this is TaskStatus.Faulted.

Param<T>.NotInRange(T, T, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is inside a range that includes its lower bound and excludes its upper bound.

extension<T>(Param<T> @this) where T : IComparable<T>
{
    public Param<T> NotInRange(T minimum, T maximum, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
minimum T
The inclusive lower bound of the range.
maximum T
The exclusive upper bound of the range.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, {2} is minimum, and {3} is maximum.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentOutOfRangeException
The value of this is greater than or equal to minimum, and less than maximum.

Param<int>.NotInRangeFor overloads

Param<int>.NotInRangeFor(string, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of a character in a specified string.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor(string text, string? message = null)
}
Parameters
this Param<int>
The Param<T> that holds the index to check.
text string
The string that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of text.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
text is null.
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the length of text.

Param<int>.NotInRangeFor<T>(ICollection<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified collection.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(ICollection<T> collection, string? message = null)
}
Type parameters
T
The type of the items of collection.
Parameters
this Param<int>
The Param<T> that holds the index to check.
collection ICollection<T>
The collection that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of collection.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
collection is null.
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the number of items of collection.

Param<int>.NotInRangeFor<T>(IReadOnlyCollection<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified read-only collection.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(IReadOnlyCollection<T> collection, string? message = null)
}
Type parameters
T
The type of the items of collection.
Parameters
this Param<int>
The Param<T> that holds the index to check.
collection IReadOnlyCollection<T>
The read-only collection that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of collection.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
collection is null.
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the number of items of collection.

Param<int>.NotInRangeFor<T>(List<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified List<T>.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(List<T> list, string? message = null)
}
Type parameters
T
The type of the items of list.
Parameters
this Param<int>
The Param<T> that holds the index to check.
list List<T>
The List<T> that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the number of items of list.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
list is null.
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the number of items of list.

Param<int>.NotInRangeFor<T>(Memory<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified Memory<T>.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(Memory<T> memory, string? message = null)
}
Type parameters
T
The type of the items of memory.
Parameters
this Param<int>
The Param<T> that holds the index to check.
memory Memory<T>
The Memory<T> that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of memory.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the length of memory.

Param<int>.NotInRangeFor<T>(ReadOnlyMemory<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified ReadOnlyMemory<T>.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(ReadOnlyMemory<T> memory, string? message = null)
}
Type parameters
T
The type of the items of memory.
Parameters
this Param<int>
The Param<T> that holds the index to check.
memory ReadOnlyMemory<T>
The ReadOnlyMemory<T> that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of memory.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the length of memory.

Param<int>.NotInRangeFor<T>(ReadOnlySpan<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified read-only span.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(ReadOnlySpan<T> span, string? message = null)
}
Type parameters
T
The type of the items of span.
Parameters
this Param<int>
The Param<T> that holds the index to check.
span ReadOnlySpan<T>
The read-only span that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of span.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the length of span.

Param<int>.NotInRangeFor<T>(Span<T>, string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified span.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(Span<T> span, string? message = null)
}
Type parameters
T
The type of the items of span.
Parameters
this Param<int>
The Param<T> that holds the index to check.
span Span<T>
The span that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of span.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the length of span.

Param<int>.NotInRangeFor<T>(T[], string?)

Throws an ArgumentOutOfRangeException if the value of a parameter is the index of an item in a specified array.

extension(Param<int> @this)
{
    public Param<int> NotInRangeFor<T>(T[] array, string? message = null)
}
Type parameters
T
The type of the items of array.
Parameters
this Param<int>
The Param<T> that holds the index to check.
array T[]
The array that the value must not be an index in.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is the length of array.
Returns

Param<int> this, for the next check of the chain.

Exceptions
ArgumentNullException
array is null.
ArgumentOutOfRangeException
The value of this is greater than or equal to zero, and less than the length of array.

Param<object>.NotOfType<TTarget>(string?)

Throws an ArgumentException if the value of a parameter is of a specified type.

extension(Param<object> @this)
{
    public Param<object> NotOfType<TTarget>(string? message = null) where TTarget : notnull
}

Type parameters

TTarget
The type that the value must not have. A type that derives from it passes the check.

Parameters

this Param<object>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is TTarget.

Returns

Param<object> this, for the next check of the chain.

Exceptions

ArgumentException
The type of the value of this is TTarget.

Param<T>.NotOfType(Type, string?)

Throws an ArgumentException if the value of a parameter is of a specified type.

extension<T>(Param<T> @this) where T : notnull
{
    public Param<T> NotOfType(Type type, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
type Type
The type that the value must not have. A type that derives from it passes the check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is type.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentNullException
type is null.
ArgumentException
The type of the value of this is type.

Param<string>.NotWhiteSpace(string?)

Throws an ArgumentException if the value of a string parameter is empty, or consists only of white-space characters.

extension(Param<string> @this)
{
    public Param<string> NotWhiteSpace(string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is the empty string, or consists only of white-space characters.

Param<T>.Null(string?)

Throws an ArgumentException if the value of a parameter is not null.

extension<T>(Param<T> @this)
{
    public Param<T> Null(string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is not null.

Param<string?>.NullOrEmpty(string?)

Throws an ArgumentException if the value of a string parameter is neither null nor empty.

extension(Param<string?> @this)
{
    public Param<string?> NullOrEmpty(string? message = null)
}

Parameters

this Param<string?>
The Param<T> that holds the string to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<string?> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one character.

Param<string?>.NullOrWhiteSpace(string?)

Throws an ArgumentException if the value of a string parameter holds a character that is not a white-space character.

extension(Param<string?> @this)
{
    public Param<string?> NullOrWhiteSpace(string? message = null)
}

Parameters

this Param<string?>
The Param<T> that holds the string to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<string?> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one character that is not a white-space character.

Remarks

The check passes if the value is null, empty, or consists only of white-space characters.

Param<object>.OfType<TTarget>(string?)

Throws an ArgumentException if the value of a parameter is not of a specified type, and continues the chain with that type.

extension(Param<object> @this)
{
    public Param<TTarget> OfType<TTarget>(string? message = null) where TTarget : notnull
}

Type parameters

TTarget
The type that the value must have. A type that derives from it does not pass the check.

Parameters

this Param<object>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is TTarget.

Returns

Param<TTarget> A Param<T> that holds the value of this, as a TTarget, and its name.

Exceptions

ArgumentException
The type of the value of this is not TTarget.

Param<T>.OfType(Type, string?)

Throws an ArgumentException if the value of a parameter is not of a specified type.

extension<T>(Param<T> @this) where T : notnull
{
    public Param<T> OfType(Type type, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
type Type
The type that the value must have. A type that derives from it does not pass the check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is type.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentNullException
type is null.
ArgumentException
The type of the value of this is not type.

Param<T>.ReferenceEqualTo(T, string?)

Throws an ArgumentException if the value of a parameter is not a specified instance.

extension<T>(Param<T> @this) where T : class
{
    public Param<T> ReferenceEqualTo(T target, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
target T
The instance that the value must be.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is target.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is not the same instance as target.

Param<T>.ReferenceNotEqualTo(T, string?)

Throws an ArgumentException if the value of a parameter is a specified instance.

extension<T>(Param<T> @this) where T : class
{
    public Param<T> ReferenceNotEqualTo(T target, string? message = null)
}

Type parameters

T
The type of the parameter.

Parameters

this Param<T>
The Param<T> that holds the value to check.
target T
The instance that the value must not be.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, {1} is its value, and {2} is target.

Returns

Param<T> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this is the same instance as target.

Param<bool>.True overloads

Param<bool>.True(FalseConditionInterpolatedStringHandler)

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Throws an ArgumentException if the value of a Boolean parameter is false, with an interpolated string as the message of the exception.

extension(Param<bool> @this)
{
    public Param<bool> True(ref FalseConditionInterpolatedStringHandler message)
}
Parameters
this Param<bool>
The Param<T> that holds the value to check.
message FalseConditionInterpolatedStringHandler
The interpolated string to use as the message of the exception. It is formatted only if the check fails, and it is not processed as a composite format string.
Returns

Param<bool> this, for the next check of the chain.

Exceptions
ArgumentException
The value of this is false.
Remarks

This method is not available in the netstandard and .NET Framework builds of Louis, because their BCL has no StringBuilder.AppendInterpolatedStringHandler.

Param<bool>.True(string?)

Throws an ArgumentException if the value of a Boolean parameter is false.

extension(Param<bool> @this)
{
    public Param<bool> True(string? message = null)
}
Parameters
this Param<bool>
The Param<T> that holds the value to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.
Returns

Param<bool> this, for the next check of the chain.

Exceptions
ArgumentException
The value of this is false.

Param<string>.WhiteSpace(string?)

Throws an ArgumentException if the value of a string parameter holds a character that is not a white-space character.

extension(Param<string> @this)
{
    public Param<string> WhiteSpace(string? message = null)
}

Parameters

this Param<string>
The Param<T> that holds the string to check.
message string?
A composite format string for the message of the exception, or null to use the default message. The format item {0} is the name of the parameter, and {1} is its value.

Returns

Param<string> this, for the next check of the chain.

Exceptions

ArgumentException
The value of this holds at least one character that is not a white-space character.

Remarks

The check passes if the value is empty, or consists only of white-space characters.