diff --git a/Source/Csla/Rules/BusinessRuleBase.cs b/Source/Csla/Rules/BusinessRuleBase.cs
index dc9aceaca6..746fb1e29d 100644
--- a/Source/Csla/Rules/BusinessRuleBase.cs
+++ b/Source/Csla/Rules/BusinessRuleBase.cs
@@ -23,6 +23,12 @@ public abstract class BusinessRuleBase : IBusinessRuleBase
private int _priority;
private RuleUri _ruleUri;
+ ///
+ /// If true, rule will only cascade if the primary property
+ /// is dirty.
+ ///
+ public bool CascadeIfDirty { get; protected set; }
+
///
/// Gets or sets a value indicating whether
/// property values should be locked because
diff --git a/Source/Csla/Rules/BusinessRules.cs b/Source/Csla/Rules/BusinessRules.cs
index b2aafaa472..01f1ca7c05 100644
--- a/Source/Csla/Rules/BusinessRules.cs
+++ b/Source/Csla/Rules/BusinessRules.cs
@@ -675,21 +675,21 @@ orderby r.Priority
propertiesToRun.Add(p);
}
- // gets a list of "affected" properties by adding
+ // gets a list rules of of "affected" properties by adding
// PrimaryProperty where property is in InputProperties
- var input = from r in TypeRules.Rules
+ var inputRules = from r in TypeRules.Rules
where !ReferenceEquals(r.PrimaryProperty, property)
&& r.PrimaryProperty != null
&& r.InputProperties != null
&& r.InputProperties.Contains(property)
- select r.PrimaryProperty;
+ select r;
var dirtyProperties = primaryResult.DirtyProperties;
- input = from r in input
- where dirtyProperties.Contains(r.Name)
- select r;
+ var inputProperties = from r in inputRules
+ where !r.CascadeIfDirty || dirtyProperties.Contains(r.PrimaryProperty.Name)
+ select r.PrimaryProperty;
- foreach (var p in input)
+ foreach (var p in inputProperties)
{
if (!ReferenceEquals(property, p))
propertiesToRun.Add(p);
diff --git a/Source/Csla/Rules/IBusinessRule.cs b/Source/Csla/Rules/IBusinessRule.cs
index bded0c2d47..45e6c1f3df 100644
--- a/Source/Csla/Rules/IBusinessRule.cs
+++ b/Source/Csla/Rules/IBusinessRule.cs
@@ -41,6 +41,11 @@ public enum RunModes
///
public interface IBusinessRuleBase
{
+ ///
+ /// If true, rule will only cascade if the primary property
+ /// is dirty.
+ ///
+ bool CascadeIfDirty { get; }
///
/// Gets a list of secondary property values to be supplied to the
/// rule when it is executed.