2using System.Collections.Generic;
20 : base(affectedProperties[0])
34 : this(affectedProperties)
45 : this(affectedProperties)
58 return HasMessageDelegate ? base.MessageText :
"One of the properties must be provided";
67 bool valueProvided =
false;
70 foreach (var value
in context.InputPropertyValues.Values)
72 if (value !=
null && !
string.IsNullOrWhiteSpace(value.ToString()))
85 var message =
string.Format(
GetMessage(), propertyInfo.FriendlyName);
Business rule for when one of two strings must be provided
OneOfSeveralStringsRequiredRule(string message, params Csla.Core.IPropertyInfo[] affectedProperties)
Creates an instance of the rule.
override void Execute(IRuleContext context)
Rule implementation.
override string GetMessage()
Gets the error message.
OneOfSeveralStringsRequiredRule(params Csla.Core.IPropertyInfo[] affectedProperties)
Creates an instance of the rule.
OneOfSeveralStringsRequiredRule(Func< string > messageDelegate, params Csla.Core.IPropertyInfo[] affectedProperties)
Creates an instance of the rule.
string RuleName
Gets a unique rule:// URI for the specific instance of the rule within the context of the business ob...
List< Csla.Core.IPropertyInfo > InputProperties
Gets a list of secondary property values to be supplied to the rule when it is executed.
Base class for a property rule
Func< string > MessageDelegate
Gets or sets the error message function for this rule.
bool HasMessageDelegate
Gets a value indicating whether this instance has message delegate.
string MessageText
Gets or sets the error message (constant).
Contains information about the result of a rule.
Maintains metadata about a property.
Context information provided to a business rule when it is invoked.
RuleSeverity
Values for validation rule severities.