How to write the business rule which affect 3 fields ?
When Position = ‘Manager’ Mdate is must
Else EDate is must
Perhaps try the ConditionRule i posted here:
http://forums.lhotka.net/forums/t/9699.aspx
// When Position is Manager then MDate is required
BusinessRules.AddRule(new ConditionRule<Required, string>(
PositionProperty, (p) => p == "Manager"
,new Required(MDateProperty)));
// When Position is not Manager then EDate is required
BusinessRules.AddRule(new ConditionRule<Required, string>(
PositionProperty, (p) => p != "Manager"
,new Required(EDateProperty)));
Copyright (c) Marimer LLC