GuardHasNElementsInRangeT Method |
[This is preliminary documentation and is subject to change.]
Checks if items has at least minimum and at most maximum number of items.
Namespace:
CSInfrastructure.CodeContracts
Assembly:
CSInfrastructure (in CSInfrastructure.dll) Version: 1.13.0+Branch.master.Sha.d583fc64569355d188a9c0818d257b6d0d3e1339
Syntax public static IEnumerable<T> HasNElementsInRange<T>(
IEnumerable<T> items,
int minimum,
int maximum,
string paramName,
string message = null
)
Parameters
- items
- Type: System.Collections.GenericIEnumerableT
The collection to check - minimum
- Type: SystemInt32
The minimum amount of items (inclusive) - maximum
- Type: SystemInt32
The maximum amount of items (inclusive) - paramName
- Type: SystemString
The name of the parameter being checked - message (Optional)
- Type: SystemString
A custom message for the exception
Type Parameters
- T
- The type of items in the collection
Return Value
Type:
IEnumerableTThe collection being tested
Exceptions Exception | Condition |
---|
ArgumentException | Thrown when items has less then minimum or more than maximum items in its collection |
See Also