Class ManifestValueInfo
An immutable model which provides information about the configuration of a value to be validated.
Inheritance
Inherited Members
Namespace: CSF.Validation.Rules
Assembly: CSF.Validation.Abstractions.dll
Syntax
public class ManifestValueInfo
Remarks
This type roughly corresponds to a ManifestItem and its derived types. The key difference between that and this 'info' class is that this type is immutable and presents a read-only API.
Constructors
| Improve this Doc View SourceManifestValueInfo(ManifestItem)
Initialises an instance of ManifestValueInfo. This is essentially a copy-constructor for a ManifestItem.
Declaration
public ManifestValueInfo(ManifestItem manifestValue)
Parameters
Type | Name | Description |
---|---|---|
ManifestItem | manifestValue | The manifest value from which to create this instance. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Properties
| Improve this Doc View SourceAccessorExceptionBehaviour
Gets or sets an optional value which indicates the desired behaviour should the value-accessor raise an exception.
Declaration
public ValueAccessExceptionBehaviour? AccessorExceptionBehaviour { get; }
Property Value
Type | Description |
---|---|
System.Nullable<ValueAccessExceptionBehaviour> |
Remarks
This option will override the behaviour specified at AccessorExceptionBehaviour for the current manifest value, if this property is set to any non-null value.
If this property is set to null then the behaviour at AccessorExceptionBehaviour will be used.
See Also
| Improve this Doc View SourceChildren
Gets a collection of the immediate descendents of the current manifest value.
Declaration
public IReadOnlyCollection<ManifestValueInfo> Children { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<ManifestValueInfo> |
CollectionItemValue
Gets an optional value object which indicates how items within a collection are to be validated.
Declaration
public ManifestValueInfo CollectionItemValue { get; }
Property Value
Type | Description |
---|---|
ManifestValueInfo |
Remarks
If the value representd by the current instance is a collection/enumerable of items then these items may be validated individually. In this scenario, the ValidatedType must be a type that implements System.Collections.Generic.IEnumerable<T> for at least one generic type.
If the current value does not represent a collection of items to be validated individually then this property will be null.
MemberName
Where the current value represents a member access invocation (such as a property getter), this property gets the name of that member.
Declaration
public string MemberName { get; }
Property Value
Type | Description |
---|---|
System.String |
ValidatedType
Gets the type of the object which the current manifest value describes.
Declaration
public Type ValidatedType { get; }
Property Value
Type | Description |
---|---|
System.Type |
Methods
| Improve this Doc View SourceGetOriginalManifestValue()
Gets a reference to the original manifest value.
Declaration
public ManifestItem GetOriginalManifestValue()
Returns
Type | Description |
---|---|
ManifestItem | The original manifest value from which this instance was created. |
Remarks
Be very careful not to mutate/alter any state of this object when using this method. The returned object is mutable, but must not be changed.