Class CriteriaApplyingMessageProviderInfoDecorator
A decorator for IGetsMessageProviderInfo which applies/filters the result of the wrapped service based upon arbitrary criteria if they are present.
Inheritance
Implements
Inherited Members
Namespace: CSF.Validation.Messages
Assembly: CSF.Validation.dll
Syntax
public class CriteriaApplyingMessageProviderInfoDecorator : IGetsMessageProviderInfo
Remarks
This service uses an implementation of IGetsNonGenericMessageCriteria in order to determine the applicable criteria to apply for the message provider. If that criteria is anything except an instance of AllowAllUsageCriteriaProvider then the returned Priority of the corresponding result will be increased by ten.
Thus, any message provider which implements an appropriate criteria-applying interface and which is permitted by that criteria will always have a higher priority than an equivalent message provider which does not implement a criteria interface.
Constructors
| Improve this Doc View SourceCriteriaApplyingMessageProviderInfoDecorator(IGetsMessageProviderInfo, IGetsNonGenericMessageCriteria)
Initialises a new instance of CriteriaApplyingMessageProviderInfoDecorator.
Declaration
public CriteriaApplyingMessageProviderInfoDecorator(IGetsMessageProviderInfo wrapped, IGetsNonGenericMessageCriteria criteriaFactory)
Parameters
Type | Name | Description |
---|---|---|
IGetsMessageProviderInfo | wrapped | A wrapped implementation |
IGetsNonGenericMessageCriteria | criteriaFactory | A criteria factory. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If any parameter is null. |
Methods
| Improve this Doc View SourceGetMessageProviderInfo(ValidationRuleResult)
Gets a collection of MessageProviderInfo which are applicable for the specified rule result.
Declaration
public IEnumerable<MessageProviderInfo> GetMessageProviderInfo(ValidationRuleResult ruleResult)
Parameters
Type | Name | Description |
---|---|---|
ValidationRuleResult | ruleResult | A validation rule result. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<MessageProviderInfo> | A collection of message provider info objects. |