Class ExpressionSpecification<T>
Class representing an expression specification.
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 class ExpressionSpecification<T> : Specification<T>, ISpecification<T>
Type Parameters
Name | Description |
---|---|
T | The target type of the specification. |
Constructors
| Improve this Doc View SourceExpressionSpecification(Func<T, Boolean>, String)
Initialize a new instance of the ExpressionSpecification<T> class.
Declaration
public ExpressionSpecification(Func<T, bool> expression, string message = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><T, System.Boolean> | expression | The validation expression. |
System.String | message | The validation error message. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | expression can not be null. |
Methods
| Improve this Doc View SourceIsSatisfiedBy(T)
Checks if the given objects satisfies the specification.
Declaration
public override 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. |
Overrides
Extend.Specification<T>.IsSatisfiedBy(T)
|
Improve this Doc
View Source
IsSatisfiedByWithMessages(T)
Checks if the given objects satisfies the specification.
Declaration
public override 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. |
Overrides
Extend.Specification<T>.IsSatisfiedByWithMessages(T)