Lets say I read this condition from a file:
Condition = "Person.Value.Status == 9"
How can I check if this condition is true in runtime providing that "Person" is a class in my code?
Lets say I read this condition from a file:
Condition = "Person.Value.Status == 9"
How can I check if this condition is true in runtime providing that "Person" is a class in my code?
While I haven't personally done this myself, this might be what you're looking for. It's an expression evaluater which is what I think you are trying to achieve.
It may be an overkill to use Spring Framework for this, but it does have nice expression evaluator.
Check documentation page.
You can add a reference to
Microsoft Script Control
and start to use JavaScript to check your condition. Here is a simple exampleTo avoid to repeatedly add
[System.Runtime.InteropServices.ComVisible(true)]
You can change the line in AssemblyInfo.cs from[assembly: ComVisible(false)]
to[assembly: ComVisible(true)]