Show / Hide Table of Contents

Class RuleWithMessageCandidateTypeDecorator

A decorator for IGetsCandidateMessageTypes which adds an additional message provider for rules which implement a rule-with-message interface.

Inheritance
System.Object
RuleWithMessageCandidateTypeDecorator
Implements
IGetsCandidateMessageTypes
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 RuleWithMessageCandidateTypeDecorator : IGetsCandidateMessageTypes
Remarks

This deals with rules which implement either IRuleWithMessage<TValidated> or IRuleWithMessage<TValidated, TParent>.

Constructors

| Improve this Doc View Source

RuleWithMessageCandidateTypeDecorator(IGetsCandidateMessageTypes)

Initialises a new instance of RuleWithMessageCandidateTypeDecorator.

Declaration
public RuleWithMessageCandidateTypeDecorator(IGetsCandidateMessageTypes wrapped)
Parameters
Type Name Description
IGetsCandidateMessageTypes wrapped

The wrapped candidate message type provider.

Exceptions
Type Condition
System.ArgumentNullException

If wrapped is null.

Methods

| Improve this Doc View Source

GetCandidateMessageProviderTypes(ValidationRuleResult)

Gets a collection of message provider types from the registry which are candidates to provide a message for the specified validation rule result.

Declaration
public IEnumerable<MessageProviderTypeInfo> GetCandidateMessageProviderTypes(ValidationRuleResult result)
Parameters
Type Name Description
ValidationRuleResult result

A validation rule result.

Returns
Type Description
System.Collections.Generic.IEnumerable<MessageProviderTypeInfo>

A collection of candidate message provider types and their priority.

Remarks

This method does not take into account the CanGetFailureMessage(ValidationRuleResult) method, or any of the equivalent methods upon IHasFailureMessageUsageCriteria<TValidated> or IHasFailureMessageUsageCriteria<TValidated, TParent>. This method only filters/selects candidate types based upon the FailureMessageStrategyAttribute and the predicate values stored there.

Further logic should be executed afterward to determine whether or not the type information provided is suitable to select as the message provider for the specified validation rule result.

Implements

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