Trying to figure out how to exploit the CSharpCodeProvider to compile string data at runtime.
In xml, i have what will amount to a predicate condition stored in a string.
I want to be able to, within the current context, execute and get the result of these statements.
for instance when
<Condition>Value=="ABCD1234"</Condition> is read and executed, it should look in the current object scope for value and return true or false based on the evaluation of the statement.
I think i'm going the right direction with CSharpCodeProvider, however all the examples i can find relate to compiling to a .DLL or .EXE, i really just want to compile in memory so i can perform the comparison and return true or false to another part of the app.
Any ideas as to how best to approach this? is CSharpCodeProvider even the best tool for the job?
Value="stuff"Value will be a property of an instantiated object.Valueproperty without additional reference (e.g.obj.Value)? You cannot inherit in this case, so you have to write same-named properties in your class which delegate the calls to the original instance.