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 ParamExtensionsRemarks
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
| Name | Description |
|---|---|
| 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
thisParam<object>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isTTarget.
Returns
Param<TTarget> A Param<T> that holds the value of this, as a TTarget, and its name.
Exceptions
ArgumentException- The value of
thisis not an instance ofTTarget.
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
thisParam<T>- The
Param<T>that holds the value to check. typeType- The type that the value must be assignable to.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istype.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentNullExceptiontypeisnull.ArgumentException- The value of
thisis not an instance oftype.
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
thisParam<T>- The
Param<T>that holds the stream to check. messagestring?- A composite format string for the message of the exception, or
nullto 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.Positionproperty of the value ofthisis not equal to itsStream.Lengthproperty. NotSupportedException- The value of
thisdoes not support seeking. ObjectDisposedException- The value of
thisis 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
thisParam<T>- The
Param<T>that holds the stream to check. messagestring?- A composite format string for the message of the exception, or
nullto 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.Positionproperty of the value ofthisis not zero. NotSupportedException- The value of
thisdoes not support seeking. ObjectDisposedException- The value of
thisis 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
thisParam<T>- The
Param<T>that holds the value to check. minimumT- The exclusive lower bound of the range.
maximumT- The exclusive upper bound of the range.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isminimum, and{3}ismaximum.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less than or equal tominimum. - or - The value ofthisis greater than or equal tomaximum.
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
thisParam<T>- The
Param<T>that holds the value to check. minimumT- The inclusive lower bound of the range.
maximumT- The inclusive upper bound of the range.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isminimum, and{3}ismaximum.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less thanminimum. - or - The value ofthisis greater thanmaximum.
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
thisParam<T>- The
Param<T>that holds the value to check. targetT- The value to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istarget.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentException- The value of
thisandtargetdiffer 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.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the stream to check. messagestring?- A composite format string for the message of the exception, or
nullto 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.CanReadproperty of the value ofthisisfalse.
Param<T>.CanSeek(string?)
Throws an ArgumentException if the value of a stream parameter does not support seeking.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the stream to check. messagestring?- A composite format string for the message of the exception, or
nullto 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.CanSeekproperty of the value ofthisisfalse.
Param<T>.CanWrite(string?)
Throws an ArgumentException if the value of a stream parameter does not support writing.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the stream to check. messagestring?- A composite format string for the message of the exception, or
nullto 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.CanWriteproperty of the value ofthisisfalse.
Param<T>.Canceled(string?)
Throws an ArgumentException if the value of a task parameter is not canceled.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis notTaskStatus.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
thisParam<T>- The
Param<T>that holds the value to check. predicateFunc<T, bool>- A function to test the value for a condition.
messagestring?- A composite format string for the message of the exception, or
nullto 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
ArgumentNullExceptionpredicateisnull.ArgumentExceptionpredicatereturnsfalsefor the value ofthis.
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
thisParam<double>- The
Param<T>that holds the value to check. targetdouble- The value to compare with.
deltadouble- The maximum distance between the value of the parameter and
target. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<double> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis greater thandelta. - or - The value ofthis,target, ordeltaisDouble.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
thisParam<int>- The
Param<T>that holds the index to check. targetint- The value to compare with.
deltauint- The maximum distance between the value of the parameter and
target. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis greater thandelta.
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
thisParam<float>- The
Param<T>that holds the value to check. targetfloat- The value to compare with.
deltafloat- The maximum distance between the value of the parameter and
target. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<float> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis greater thandelta. - or - The value ofthis,target, ordeltaisSingle.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
thisParam<long>- The
Param<T>that holds the value to check. targetlong- The value to compare with.
deltaulong- The maximum distance between the value of the parameter and
target. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<long> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis greater thandelta.
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
thisParam<nint>- The
Param<T>that holds the value to check. targetnint- The value to compare with.
deltanuint- The maximum distance between the value of the parameter and
target. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<nint> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis greater thandelta.
Param<T>.Completed(string?)
Throws an ArgumentException if the value of a task parameter is not completed.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis notTaskStatus.RanToCompletion,TaskStatus.Faulted, orTaskStatus.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
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis notTaskStatus.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
thisParam<T>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis not equal to the default value ofT.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds at least one item.
Param<string>.Empty(string?)
Throws an ArgumentException if the value of a string parameter is not empty.
Parameters
thisParam<string>- The
Param<T>that holds the string to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds at least one item.
Param<IList<T>>.Empty(string?)
Throws an ArgumentException if the value of a list parameter is not empty.
Type parameters
T- The type of the items of the list.
Parameters
thisParam<IList<T>>- The
Param<T>that holds the list to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds at least one item.
Param<Memory<T>>.Empty(string?)
Throws an ArgumentException if the value of a Memory<T> parameter is not empty.
Type parameters
T- The type of the items of the
Memory<T>.
Parameters
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds at least one item.
Param<List<T>>.Empty(string?)
Throws an ArgumentException if the value of a List<T> parameter is not empty.
Type parameters
T- The type of the items of the
List<T>.
Parameters
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds at least one item.
Param<T[]>.Empty(string?)
Throws an ArgumentException if the value of an array parameter is not empty.
Type parameters
T- The type of the items of the array.
Parameters
thisParam<T[]>- The
Param<T>that holds the array to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<T>- The
Param<T>that holds the value to check. targetT- The value to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istarget.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentException- The value of
thisis not equal totarget.
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
thisParam<bool>- The
Param<T>that holds the value to check. messageTrueConditionInterpolatedStringHandler- 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
thisistrue.
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.
Parameters
thisParam<bool>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisistrue.
Param<T>.Faulted(string?)
Throws an ArgumentException if the value of a task parameter is not faulted.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis notTaskStatus.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
thisParam<T>- The
Param<T>that holds the value to check. thresholdT- The value to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isthreshold.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less than or equal tothreshold.
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
thisParam<T>- The
Param<T>that holds the value to check. thresholdT- The value to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isthreshold.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less thanthreshold.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. otherICollection<T>- The collection whose number of items the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<IReadOnlyList<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis not equal to the number of items ofother.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. sizeint- The number of items that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. sizeint- The length that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. otherReadOnlyMemory<T>- The
ReadOnlyMemory<T>whose length the value must have. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, 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
thisis not equal to the length ofother.
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
thisParam<string>- The
Param<T>that holds the string to check. sizeint- The length that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<string>- The
Param<T>that holds the string to check. otherstring- The string whose length the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, and{3}is the length of the value.
Returns
Param<string> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The length of the value of
thisis not equal to the length ofother.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. otherICollection<T>- The collection whose number of items the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<IReadOnlyCollection<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis not equal to the number of items ofother.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. sizeint- The number of items that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. otherICollection<T>- The collection whose number of items the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<IList<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis not equal to the number of items ofother.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. sizeint- The number of items that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. sizeint- The length that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. otherReadOnlyMemory<T>- The
ReadOnlyMemory<T>whose length the value must have. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, 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
thisis not equal to the length ofother.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. otherICollection<T>- The collection whose number of items the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<List<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis not equal to the number of items ofother.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. sizeint- The number of items that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. sizeint- The length that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. otherT[]- The array whose length the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, and{3}is the length of the value.
Returns
Param<T[]> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The length of the value of
thisis not equal to the length ofother.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. otherICollection<T>- The collection whose number of items the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<ICollection<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis not equal to the number of items ofother.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. sizeint- The number of items that the value must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis not equal tosize.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<string>- The
Param<T>that holds the string to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less than or equal tosize.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<string>- The
Param<T>that holds the string to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis less thansize.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<string>- The
Param<T>that holds the string to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater than or equal tosize.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. otherICollection<T>- The collection whose number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<IReadOnlyList<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis greater than the number of items ofother.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. otherReadOnlyMemory<T>- The
ReadOnlyMemory<T>whose length to compare with. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, 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
thisis greater than the length ofother.
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
thisParam<string>- The
Param<T>that holds the string to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<string>- The
Param<T>that holds the string to check. otherstring- The string whose length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, and{3}is the length of the value.
Returns
Param<string> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The length of the value of
thisis greater than the length ofother.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. otherICollection<T>- The collection whose number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<IReadOnlyCollection<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis greater than the number of items ofother.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. otherICollection<T>- The collection whose number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<IList<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis greater than the number of items ofother.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. otherReadOnlyMemory<T>- The
ReadOnlyMemory<T>whose length to compare with. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, 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
thisis greater than the length ofother.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. otherICollection<T>- The collection whose number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<List<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis greater than the number of items ofother.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. sizeint- The length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. otherT[]- The array whose length to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the length ofother, and{3}is the length of the value.
Returns
Param<T[]> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The length of the value of
thisis greater than the length ofother.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. otherICollection<T>- The collection whose number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}is the number of items ofother, and{3}is the number of items of the value.
Returns
Param<ICollection<T>> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionotherisnull.ArgumentException- The number of items of the value of
thisis greater than the number of items ofother.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. sizeint- The number of items to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis greater thansize.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. sizeint- The number of items that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. sizeint- The length that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<string>- The
Param<T>that holds the string to check. sizeint- The length that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. sizeint- The number of items that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<IList<T>>- The
Param<T>that holds the list to check. sizeint- The number of items that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. sizeint- The length that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. sizeint- The number of items that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<T[]>- The
Param<T>that holds the array to check. sizeint- The length that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. sizeint- The number of items that the value must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}issize, 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
thisis equal tosize.
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
thisParam<T>- The
Param<T>that holds the task to check. statusTaskStatus- The status that the task must have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isstatus, 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
thisis notstatus.
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
thisParam<T>- The
Param<T>that holds the task to check. statusTaskStatus- The status that the task must not have.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isstatus, 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
thisisstatus.
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
thisParam<T>- The
Param<T>that holds the value to check. minimumT- The inclusive lower bound of the range.
maximumT- The exclusive upper bound of the range.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isminimum, and{3}ismaximum.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less thanminimum. - or - The value ofthisis greater than or equal tomaximum.
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.
Parameters
thisParam<int>- The
Param<T>that holds the index to check. textstring- The string that the value must be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length oftext.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptiontextisnull.ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the length oftext.
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
thisParam<int>- The
Param<T>that holds the index to check. collectionICollection<T>- The collection that the value must be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto 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 ofcollection.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptioncollectionisnull.ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the number of items ofcollection.
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
thisParam<int>- The
Param<T>that holds the index to check. collectionIReadOnlyCollection<T>- The read-only collection that the value must be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto 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 ofcollection.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptioncollectionisnull.ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the number of items ofcollection.
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
thisParam<int>- The
Param<T>that holds the index to check. listList<T>- The
List<T>that the value must be an index in. messagestring?- A composite format string for the message of the exception, or
nullto 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 oflist.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionlistisnull.ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the number of items oflist.
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
thisParam<int>- The
Param<T>that holds the index to check. memoryMemory<T>- The
Memory<T>that the value must be an index in. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofmemory.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the length ofmemory.
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
thisParam<int>- The
Param<T>that holds the index to check. memoryReadOnlyMemory<T>- The
ReadOnlyMemory<T>that the value must be an index in. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofmemory.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the length ofmemory.
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
thisParam<int>- The
Param<T>that holds the index to check. spanReadOnlySpan<T>- The read-only span that the value must be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofspan.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the length ofspan.
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
thisParam<int>- The
Param<T>that holds the index to check. spanSpan<T>- The span that the value must be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofspan.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the length ofspan.
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.
Type parameters
T- The type of the items of
array.
Parameters
thisParam<int>- The
Param<T>that holds the index to check. arrayT[]- The array that the value must be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofarray.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionarrayisnull.ArgumentOutOfRangeException- The value of
thisis less than zero. - or - The value ofthisis greater than or equal to the length ofarray.
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
thisParam<T>- The
Param<T>that holds the value to check. thresholdT- The value to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isthreshold.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater than or equal tothreshold.
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
thisParam<T>- The
Param<T>that holds the value to check. thresholdT- The value to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isthreshold.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater thanthreshold.
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
thisParam<object>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isTTarget.
Returns
Param<object> this, for the next check of the chain.
Exceptions
ArgumentException- The value of
thisis an instance ofTTarget.
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
thisParam<T>- The
Param<T>that holds the value to check. typeType- The type that the value must not be assignable to.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istype.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentNullExceptiontypeisnull.ArgumentException- The value of
thisis an instance oftype.
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
thisParam<T>- The
Param<T>that holds the value to check. minimumT- The exclusive lower bound of the range.
maximumT- The exclusive upper bound of the range.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isminimum, and{3}ismaximum.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater thanminimum, and less thanmaximum.
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
thisParam<T>- The
Param<T>that holds the value to check. minimumT- The inclusive lower bound of the range.
maximumT- The inclusive upper bound of the range.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isminimum, and{3}ismaximum.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater than or equal tominimum, and less than or equal tomaximum.
Param<T>.NotCanceled(string?)
Throws an ArgumentException if the value of a task parameter is canceled.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisisTaskStatus.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
thisParam<double>- The
Param<T>that holds the value to check. targetdouble- The value to compare with.
deltadouble- The distance between the value of the parameter and
targetthat the value must exceed. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<double> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis less than or equal todelta. - or - The value ofthis,target, ordeltaisDouble.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
thisParam<int>- The
Param<T>that holds the index to check. targetint- The value to compare with.
deltauint- The distance between the value of the parameter and
targetthat the value must exceed. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis less than or equal todelta.
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
thisParam<float>- The
Param<T>that holds the value to check. targetfloat- The value to compare with.
deltafloat- The distance between the value of the parameter and
targetthat the value must exceed. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<float> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis less than or equal todelta. - or - The value ofthis,target, ordeltaisSingle.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
thisParam<long>- The
Param<T>that holds the value to check. targetlong- The value to compare with.
deltaulong- The distance between the value of the parameter and
targetthat the value must exceed. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<long> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis less than or equal todelta.
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
thisParam<nint>- The
Param<T>that holds the value to check. targetnint- The value to compare with.
deltanuint- The distance between the value of the parameter and
targetthat the value must exceed. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}istarget, and{3}isdelta.
Returns
Param<nint> this, for the next check of the chain.
Exceptions
ArgumentException- The distance between the value of
thisandtargetis less than or equal todelta.
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
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisisTaskStatus.RanToCompletion,TaskStatus.Faulted, orTaskStatus.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
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisisTaskStatus.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
thisParam<T>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis equal to the default value ofT.
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
thisParam<IReadOnlyList<T>>- The
Param<T>that holds the read-only list to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<ReadOnlyMemory<T>>- The
Param<T>that holds theReadOnlyMemory<T>to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds no item.
Param<string>.NotEmpty(string?)
Throws an ArgumentException if the value of a string parameter is empty.
Parameters
thisParam<string>- The
Param<T>that holds the string to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis 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
thisParam<IReadOnlyCollection<T>>- The
Param<T>that holds the read-only collection to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds no item.
Param<IList<T>>.NotEmpty(string?)
Throws an ArgumentException if the value of a list parameter is empty.
Type parameters
T- The type of the items of the list.
Parameters
thisParam<IList<T>>- The
Param<T>that holds the list to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds no item.
Param<Memory<T>>.NotEmpty(string?)
Throws an ArgumentException if the value of a Memory<T> parameter is empty.
Type parameters
T- The type of the items of the
Memory<T>.
Parameters
thisParam<Memory<T>>- The
Param<T>that holds theMemory<T>to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds no item.
Param<List<T>>.NotEmpty(string?)
Throws an ArgumentException if the value of a List<T> parameter is empty.
Type parameters
T- The type of the items of the
List<T>.
Parameters
thisParam<List<T>>- The
Param<T>that holds theList<T>to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds no item.
Param<T[]>.NotEmpty(string?)
Throws an ArgumentException if the value of an array parameter is empty.
Type parameters
T- The type of the items of the array.
Parameters
thisParam<T[]>- The
Param<T>that holds the array to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<ICollection<T>>- The
Param<T>that holds the collection to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<T>- The
Param<T>that holds the value to check. targetT- The value to compare with.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istarget.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentException- The value of
thisis equal totarget.
Param<T>.NotFaulted(string?)
Throws an ArgumentException if the value of a task parameter is faulted.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the task to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisisTaskStatus.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
thisParam<T>- The
Param<T>that holds the value to check. minimumT- The inclusive lower bound of the range.
maximumT- The exclusive upper bound of the range.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value,{2}isminimum, and{3}ismaximum.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater than or equal tominimum, and less thanmaximum.
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
thisParam<int>- The
Param<T>that holds the index to check. textstring- The string that the value must not be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length oftext.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptiontextisnull.ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the length oftext.
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
thisParam<int>- The
Param<T>that holds the index to check. collectionICollection<T>- The collection that the value must not be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto 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 ofcollection.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptioncollectionisnull.ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the number of items ofcollection.
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
thisParam<int>- The
Param<T>that holds the index to check. collectionIReadOnlyCollection<T>- The read-only collection that the value must not be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto 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 ofcollection.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptioncollectionisnull.ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the number of items ofcollection.
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
thisParam<int>- The
Param<T>that holds the index to check. listList<T>- The
List<T>that the value must not be an index in. messagestring?- A composite format string for the message of the exception, or
nullto 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 oflist.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionlistisnull.ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the number of items oflist.
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
thisParam<int>- The
Param<T>that holds the index to check. memoryMemory<T>- The
Memory<T>that the value must not be an index in. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofmemory.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the length ofmemory.
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
thisParam<int>- The
Param<T>that holds the index to check. memoryReadOnlyMemory<T>- The
ReadOnlyMemory<T>that the value must not be an index in. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofmemory.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the length ofmemory.
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
thisParam<int>- The
Param<T>that holds the index to check. spanReadOnlySpan<T>- The read-only span that the value must not be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofspan.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the length ofspan.
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
thisParam<int>- The
Param<T>that holds the index to check. spanSpan<T>- The span that the value must not be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofspan.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the length ofspan.
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
thisParam<int>- The
Param<T>that holds the index to check. arrayT[]- The array that the value must not be an index in.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}is the length ofarray.
Returns
Param<int> this, for the next check of the chain.
Exceptions
ArgumentNullExceptionarrayisnull.ArgumentOutOfRangeException- The value of
thisis greater than or equal to zero, and less than the length ofarray.
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
thisParam<object>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isTTarget.
Returns
Param<object> this, for the next check of the chain.
Exceptions
ArgumentException- The type of the value of
thisisTTarget.
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
thisParam<T>- The
Param<T>that holds the value to check. typeType- The type that the value must not have. A type that derives from it passes the check.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istype.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentNullExceptiontypeisnull.ArgumentException- The type of the value of
thisistype.
Param<string>.NotWhiteSpace(string?)
Throws an ArgumentException if the value of a string parameter is empty, or consists only of white-space characters.
Parameters
thisParam<string>- The
Param<T>that holds the string to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis 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.
Type parameters
T- The type of the parameter.
Parameters
thisParam<T>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisis notnull.
Param<string?>.NullOrEmpty(string?)
Throws an ArgumentException if the value of a string parameter is neither null nor empty.
Parameters
thisParam<string?>- The
Param<T>that holds the string to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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.
Parameters
thisParam<string?>- The
Param<T>that holds the string to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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
thisParam<object>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}isTTarget.
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
thisis notTTarget.
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
thisParam<T>- The
Param<T>that holds the value to check. typeType- The type that the value must have. A type that derives from it does not pass the check.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istype.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentNullExceptiontypeisnull.ArgumentException- The type of the value of
thisis nottype.
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
thisParam<T>- The
Param<T>that holds the value to check. targetT- The instance that the value must be.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istarget.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentException- The value of
thisis not the same instance astarget.
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
thisParam<T>- The
Param<T>that holds the value to check. targetT- The instance that the value must not be.
messagestring?- A composite format string for the message of the exception, or
nullto use the default message. The format item{0}is the name of the parameter,{1}is its value, and{2}istarget.
Returns
Param<T> this, for the next check of the chain.
Exceptions
ArgumentException- The value of
thisis the same instance astarget.
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
thisParam<bool>- The
Param<T>that holds the value to check. messageFalseConditionInterpolatedStringHandler- 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
thisisfalse.
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.
Parameters
thisParam<bool>- The
Param<T>that holds the value to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisisfalse.
Param<string>.WhiteSpace(string?)
Throws an ArgumentException if the value of a string parameter holds a character that is not a white-space character.
Parameters
thisParam<string>- The
Param<T>that holds the string to check. messagestring?- A composite format string for the message of the exception, or
nullto 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
thisholds 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.