Interface ISpecification<T>
Interface representing a specification.
Namespace:Extend
Assembly:Extend.dll
Syntax
public interface 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
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. |
IsSatisfiedBy(T)
Checks if the given objects satisfies the specification.
Declaration
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. |
IsSatisfiedByWithMessages(T)
Checks if the given objects satisfies the specification.
Declaration
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. |
Or(ISpecification<T>)
Combines the current specification with the given specification using a OR link.
Declaration
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. |
XOr(ISpecification<T>)
Combines the current specification with the given specification using a XOR link.
Declaration
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. |