Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parameter conversion in RuleContext.AddOutputValue #3251

Closed
EricNgo1972 opened this issue Feb 6, 2023 · 1 comment · Fixed by #3925
Closed

Support parameter conversion in RuleContext.AddOutputValue #3251

EricNgo1972 opened this issue Feb 6, 2023 · 1 comment · Fixed by #3925
Assignees

Comments

@EricNgo1972
Copy link

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

@rockfordlhotka
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants