Show / Hide Table of Contents

Class CriteriaApplyingMessageProviderInfoDecorator

A decorator for IGetsMessageProviderInfo which applies/filters the result of the wrapped service based upon arbitrary criteria if they are present.

Inheritance
System.Object
CriteriaApplyingMessageProviderInfoDecorator
Implements
IGetsMessageProviderInfo
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: 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 Source

CriteriaApplyingMessageProviderInfoDecorator(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 Source

GetMessageProviderInfo(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.

Implements

IGetsMessageProviderInfo
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX