Class ModelRuleToManifestRuleConverter
A service which converts the rules within a Value into manifest rules and to add those rules to a corresponding ManifestItem
Inheritance
Implements
Inherited Members
Namespace: CSF.Validation.ManifestModel
Assembly: CSF.Validation.dll
Syntax
public class ModelRuleToManifestRuleConverter : IConvertsModelRulesToManifestRules
Constructors
| Improve this Doc View SourceModelRuleToManifestRuleConverter(IGetsRuleConfiguration, IResolvesRuleType, IGetsManifestRuleIdentifierFromRelativeIdentifier)
Initialises an instance of ModelRuleToManifestRuleConverter.
Declaration
public ModelRuleToManifestRuleConverter(IGetsRuleConfiguration configProvider, IResolvesRuleType ruleTypeResolver, IGetsManifestRuleIdentifierFromRelativeIdentifier relativeToManifestIdentifierConverter)
Parameters
Type | Name | Description |
---|---|---|
IGetsRuleConfiguration | configProvider | A rule-configuration provider. |
IResolvesRuleType | ruleTypeResolver | A rule-type resolver. |
IGetsManifestRuleIdentifierFromRelativeIdentifier | relativeToManifestIdentifierConverter | A converter which turns relative identifiers into manifest identifiers. |
Methods
| Improve this Doc View SourceConvertAllRulesAndAddToManifestValues(IEnumerable<ModelAndManifestValuePair>)
Converts all of the rules present in each of the Value models into ManifestRule instances and then adds those rules to the corresponding ManifestItem instance in the model/manifest value pair.
Declaration
public void ConvertAllRulesAndAddToManifestValues(IEnumerable<ModelAndManifestValuePair> values)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ModelAndManifestValuePair> | values | A collection of ModelAndManifestValuePair. |
Remarks
The input parameter is a collection of objects, each of which contains both a ManifestItem and also the model Value from which that manifest value was created. This method gets the rules from within that model value, converts them and then adds those the the corresponding manifest value. This process occurs for each item in the input collection.