csla icon indicating copy to clipboard operation
csla copied to clipboard

Support parameter conversion in RuleContext.AddOutputValue

Open EricNgo1972 opened this issue 2 years ago • 1 comments

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; }

EricNgo1972 avatar Feb 06 '23 19:02 EricNgo1972

That seems like a nice enhancement, thanks for the suggestion.

rockfordlhotka avatar Feb 23 '23 21:02 rockfordlhotka