Class RuleResultIsForDescendentOfValue
A specification for validation rule results which must be for a specified value, or a descendent of that value.
Inheritance
Implements
Inherited Members
Namespace: CSF.Validation
Assembly: CSF.Validation.dll
Syntax
public class RuleResultIsForDescendentOfValue : ISpecificationExpression<ValidationRuleResult>
Constructors
| Improve this Doc View SourceRuleResultIsForDescendentOfValue(ManifestItem, Boolean)
Initialises a new instance of RuleResultIsForDescendentOfValue without a validated item instance.
Declaration
public RuleResultIsForDescendentOfValue(ManifestItem value, bool allowAncestors = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ManifestItem | value | A manifest value which rules must be a descendent of in order to match the spec. |
| System.Boolean | allowAncestors | If true then rule results will match if the value appears in any ancestor context, as well as the rule's own context. If false then only the rule's immediate context will be searched, indicating that this is a specification for immediate children only. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If |
RuleResultIsForDescendentOfValue(ManifestItem, Object, Boolean)
Initialises a new instance of RuleResultIsForDescendentOfValue with a validated item instance..
Declaration
public RuleResultIsForDescendentOfValue(ManifestItem value, object item, bool allowAncestors = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ManifestItem | value | A manifest value which rules must be a descendent of in order to match the spec. |
| System.Object | item | An optional item (of the type indicated by the |
| System.Boolean | allowAncestors | If true then rule results will match if the value appears in any ancestor context, as well as the rule's own context. If false then only the rule's immediate context will be searched, indicating that this is a specification for immediate children only. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If |
Methods
| Improve this Doc View SourceGetExpression()
Gets an expression which represents the current specification instance.
Declaration
public Expression<Func<ValidationRuleResult, bool>> GetExpression()
Returns
| Type | Description |
|---|---|
| System.Linq.Expressions.Expression<System.Func<ValidationRuleResult, System.Boolean>> | The specification expression. |