We would like to mask some information in our business objects based on roles, seeing that our codebase is shared between multiple projects we would like to do this in the business logic instead of in the UI.
Our idea was to override
the LoadProperty
method within the CSLA so that we can change the value once instead of setting it to the unmasked value, then masking after DataPortal_Fetch
. The issue is that the virtual LoadProperty
method is never fired, see code below:
protected override void LoadProperty(IPropertyInfo propertyInfo, object newValue)
{
//Do masking
newValue = DoMask(newValue, maskAttribute);
base.LoadProperty(propertyInfo, newValue);
}
Below are the two methods within the BusinessBase
, but only one is virtual
:
protected void LoadProperty<P>(PropertyInfo<P> propertyInfo, P newValue);
protected virtual void LoadProperty(IPropertyInfo propertyInfo, object newValue);