LessThanOrEqualSpecification<T> Class

Summary

Checks if candidate object is lower than or equal to expected value.
graph BT Type-->Base0["BaseLessCompareSpecification<T>"] Base0-->Base1["BaseCompareSpecification<T>"] Base1-->Base2["ComplexSpecification<T>"] Base2-->Base3["NegatableValidationSpecification<T>"] Base3-->Base4["ValidationSpecification<T>"] Base4-->Base5["object"] Type-.->Interface0["INegatableValidationSpecification<T>"] Type-.->Interface1["IComplexSpecification<T>"] Type-.->Interface2["IValidationSpecification<T>"] Type-.->Interface3["ILinqSpecification<T>"] Type-.->Interface4["ILinqSpecification"] click Interface4 "/FluentSpecification/api/FluentSpecification.Abstractions/ILinqSpecification" Type-.->Interface5["ISpecification<T>"] Type-.->Interface6["INegatableLinqSpecification<T>"] Type-.->Interface7["INegatableSpecification<T>"] Type-.->Interface8["ISpecification"] click Interface8 "/FluentSpecification/api/FluentSpecification.Abstractions/ISpecification" Type["LessThanOrEqualSpecification<T>"] class Type type-node

Syntax

[PublicAPI]
public sealed class LessThanOrEqualSpecification<T> : BaseLessCompareSpecification<T>, 
    INegatableValidationSpecification<T>, IComplexSpecification<T>, IValidationSpecification<T>, 
    ILinqSpecification<T>, ILinqSpecification, ISpecification<T>, INegatableLinqSpecification<T>, 
    INegatableSpecification<T>, ISpecification

Remarks

Specification for comparison use:
  1. ComparerIComparer<T> - if available.
  2. LessThan operatorif defined for T.
  3. CompareTo() method if T implements System.IComparable`1.
  4. CompareTo(Object) method if T implements System.IComparable.

Note that null is always the lowest value.

Attributes

Type Description
PublicAPI

Type Parameters

Name Description
T Type of compared objects.

Constructors

Name Summary
LessThanOrEqualSpecification(T, IComparer<T>) Creates Specification for candidate value comparison.

Methods

Name Value Summary
BuildExpressionBodyWithoutLimit(Expression) Expression
Creates special Expression body when Limit value is not defined.
CreateFailedMessage(T) string
Gets validation failed message of Specification for candidate content.
CreateNegationFailedMessage(T) string
Gets validation negation failed message of Specification for candidate content.

Operators

Name Value Summary
explicit operator Expression(ComplexSpecification<T>) Expression
Inherited from ComplexSpecification<T>
implicit operator Expression<Func<T, bool>>(ComplexSpecification<T>) Expression<Func<T, bool>>
Inherited from ComplexSpecification<T>
implicit operator Func<T, bool>(ValidationSpecification<T>) Func<T, bool>
Inherited from ValidationSpecification<T>

Extension Methods

Name Value Summary
And<T, TSpecification>() IComplexSpecification<T>
Creates logical AND Specification with newly created TSpecification.
And<T>() ICompositeSpecification<T>
Creates composite Specification proxy for final logical AND Specification.
And<T>(ISpecification<T>) IComplexSpecification<T>
Creates logical AND Specification.
AndNot<T, TSpecification>() IComplexSpecification<T>
Creates logical AND Specification with newly created and negated TSpecification.
AndNot<T>() ICompositeSpecification<T>
Creates composite Specification proxy for final logical AND Specification. Second Specification is negated.
AndNot<T>(ISpecification<T>) IComplexSpecification<T>
Creates logical AND Specification with negated other.
AsComplexSpecification<T>() IComplexSpecification<T>
Converts Specification to complex Specification.
AsExpression<T>() Expression<Func<T, bool>>
Converts Specification to Linq Expression<T>.
AsPredicate<T>() Func<T, bool>
Converts Specification to Func<T, TResult> predicate.
Not<T>() IComplexSpecification<T>
Creates logical NOT Specification.
Or<T, TSpecification>() IComplexSpecification<T>
Creates logical OR Specification with newly created TSpecification.
Or<T>() ICompositeSpecification<T>
Creates composite Specification proxy for final logical OR Specification.
Or<T>(ISpecification<T>) IComplexSpecification<T>
Creates logical OR Specification.
OrNot<T, TSpecification>() IComplexSpecification<T>
Creates logical OR Specification with newly created and negated TSpecification.
OrNot<T>() ICompositeSpecification<T>
Creates composite Specification proxy for final logical OR Specification. Second Specification is negated.
OrNot<T>(ISpecification<T>) IComplexSpecification<T>
Creates logical OR Specification with negated other.
WithMessage<T>(Func<T, IReadOnlyDictionary<string, object>, string>) IComplexSpecification<T>
Creates validation Specification proxy with specific error message factory where not satisfied by.
WithMessage<T>(Func<T, string>) IComplexSpecification<T>
Creates validation Specification proxy with specific error message factory where not satisfied by.
WithMessage<T>(string) IComplexSpecification<T>
Creates validation Specification proxy with specific error message where not satisfied by.
GitHub