Source/Csla.test/ValidationRules/RuleBaseClassesRoot.cs
/// <summary>
/// Does the check for primary propert less than compareTo property
/// </summary>
/// <param name="context">Rule context object.</param>
Does the check for primary propert less than compareTo property
Does the check for primary propert less than compareTo property
protected override void Execute(IRuleContext context)
    {
      var value1 = (IComparable)context.InputPropertyValues[PrimaryProperty];
      var value2 = (IComparable)context.InputPropertyValues[CompareTo];
      if (value1.CompareTo(value2) >= 0)
      {
        context.AddErrorResult(string.Format("{0} must be less than {1}", PrimaryProperty.FriendlyName, CompareTo.FriendlyName));
        context.AddErrorResult(CompareTo, string.Format("{0} must be larger than {1}", CompareTo.FriendlyName, PrimaryProperty.FriendlyName));
      }
    }
protected override void Execute ( IRuleContext context ) { var value1 = ( IComparable ) context . InputPropertyValues [ PrimaryProperty ] ; var value2 = ( IComparable ) context . InputPropertyValues [ CompareTo ] ; if ( value1 . CompareTo ( value2 ) >= 0 ) { context . AddErrorResult ( string . Format ( " " , PrimaryProperty . FriendlyName , CompareTo . FriendlyName ) ) ; context . AddErrorResult ( CompareTo , string . Format ( " " , CompareTo . FriendlyName , PrimaryProperty . FriendlyName ) ) ; } }
Does the check for primary propert less than compareTo property
Does the check for primary propert less than compareTo property
context
IRuleContext
Rule context object.
Rule context object .