asulwer / RulesEngine

Rules Engine with extensive Dynamic expression support
MIT License
26 stars 1 forks source link

Preserve Original ExpandoObject and Implement TryGetPropertyValue in RuleParameter #55

Closed RenanCarlosPereira closed 4 months ago

RenanCarlosPereira commented 4 months ago

Summary of Changes

  1. Added OriginalValue Property:

    • Preserves the original ExpandoObject without converting its type.
  2. Implemented TryGetPropertyValue Method:

    • Safely accesses properties, returning a boolean indicating success and setting the out parameter to the property value or null if not found.
  3. Created Unit Tests:

    • Tests for TryGetPropertyValue behavior and ensuring OriginalValue is correctly set in the constructor.

Reason for Changes

The issue involved the RuleParameter class transforming ExpandoObject into a strongly-typed object, causing a loss of the expected type when casting back. The changes ensure that both the original dynamic object and the typed version are accessible, maintaining data integrity throughout the workflow execution.

asulwer commented 4 months ago

https://github.com/asulwer/RulesEngine/issues/53