Class Specification<T>
Abstract base class for a specification.
Inheritance
System.Object
Specification<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:Extend
Assembly:Extend.dll
Syntax
public abstract class Specification<T> : ISpecification<T>
Type Parameters
Name | Description |
---|---|
T | The target type of the specification. |
Methods
| Improve this Doc View SourceAnd(ISpecification<T>)
Combines the current specification with the given specification using an AND link.
Declaration
public ISpecification<T> And(ISpecification<T> specification)
Parameters
Type | Name | Description |
---|---|---|
ISpecification<T><T> | specification | The specification to add. |
Returns
Type | Description |
---|---|
ISpecification<T><T> | Returns the combined specifications. |
Implements
| Improve this Doc View SourceIsSatisfiedBy(T)
Checks if the given objects satisfies the specification.
Declaration
public abstract bool IsSatisfiedBy(T obj)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object to validate. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the object satisfies the specification; otherwise, false. |
Implements
| Improve this Doc View SourceIsSatisfiedByWithMessages(T)
Checks if the given objects satisfies the specification.
Declaration
public abstract IEnumerable<string> IsSatisfiedByWithMessages(T obj)
Parameters
Type | Name | Description |
---|---|---|
T | obj | The object to validate. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><System.String> | Returns a collection of error messages. |
Implements
| Improve this Doc View SourceOr(ISpecification<T>)
Combines the current specification with the given specification using a OR link.
Declaration
public ISpecification<T> Or(ISpecification<T> specification)
Parameters
Type | Name | Description |
---|---|---|
ISpecification<T><T> | specification | The specification to add. |
Returns
Type | Description |
---|---|
ISpecification<T><T> | Returns the combined specifications. |
Implements
| Improve this Doc View SourceXOr(ISpecification<T>)
Combines the current specification with the given specification using a XOR link.
Declaration
public ISpecification<T> XOr(ISpecification<T> specification)
Parameters
Type | Name | Description |
---|---|---|
ISpecification<T><T> | specification | The specification to add. |
Returns
Type | Description |
---|---|
ISpecification<T><T> | Returns the combined specifications. |