Target object always empty in Validation Rules (CSLA 3.5)

Target object always empty in Validation Rules (CSLA 3.5)

Old forum URL: forums.lhotka.net/forums/t/5438.aspx


gamaroff posted on Monday, September 22, 2008

I have a simple validation method. The target argument that is passed through to the ValidCode method is always empty. It never has values in it despite the object being populated. I see that the object has values because it binds successfully to a grid and displays the values.

Is there something missing? Any help is greatly appreciated. Thanks!

The code is as follows:

protected override void AddBusinessRules()
{
   ValidationRules.AddRule(ValidCode, OperatorCodeProperty);
}



private
static bool ValidCode(object target, RuleArgs
e)
{

    string
value = Utilities.CallByName(target, e.PropertyName, CallType
.Get).ToString();
   
   
// Do something with the value

}

Copyright (c) Marimer LLC