csla
csla copied to clipboard
Support parameter conversion in RuleContext.AddOutputValue
Currently, AddOutputValue in RuleContext does not support parameter conversion like SetPropertyConvert<F,P>.
public void AddOutValue(Csla.Core.IPropertyInfo property, object value) { _outputPropertyValues.Value[property] = value; }
May be adding support for parameter conversion make it easier to use, especially when the managed field is smart types (SmartDate)?
public void AddOutValue(Csla.Core.IPropertyInfo property, object value) { if(value is not null) _outputPropertyValues.Value[property] = Csla.Utilities.CoerceValue(PrimaryProperty.Type, value.GetType(), null, value); else _outputPropertyValues.Value[property] = PrimaryProperty.DefaultValue; }
That seems like a nice enhancement, thanks for the suggestion.