Specification.

NotLengthBetween<T, TProperty>(ICompositeSpecification<T>, Expression<Func<T, TProperty>>, int, int) Method

Summary

Composes self Specification with LengthBetweenSpecification<T> negation for candidate property:

Checks if length of candidate property is not between Min and Max values.

Namespace
FluentSpecification
Containing Type
Specification

Syntax

[PublicAPI]
[NotNull]
public static IComplexSpecification<T> NotLengthBetween<T, TProperty>(this ICompositeSpecification<T> self, Expression<Func<T, TProperty>> selector, int minLength, int maxLength) 
    where TProperty : IEnumerable

Attributes

Type Description
PublicAPI
NotNull

Type Parameters

Name Description
T Type of candidate.
TProperty Type of candidate property to verify (collection or string).

Parameters

Name Type Description
self ICompositeSpecification<T> Self specification.
selector Expression<Func<T, TProperty>> Candidate property selector.
minLength int Not minimum candidate property length.
maxLength int Not maximum candidate property length.

Return Value

Type Description
IComplexSpecification<T> Composed complex Specification.

Exceptions

Type Description
System.ArgumentNullException Thrown when self or selector is null.
System.ArgumentException Thrown when selector is not valid.
System.ArgumentException Thrown when maxLength is lower than minLength.
GitHub