tags:

views:

73

answers:

1

I have a class with a property of type Expression> and I want to set this property with a string like "m => m.A + m.B = m.C".

If I write this as new Type(){propertyName = m => m.A + m.B = m.C} sets this property to a true return.

I want to be able to do this:

string s = "m => m.A + m.B = m.C";
Type<T> t = new Type<T>(){propertyName = s}

if(t.propertyName){//do something}

I have a collection of strings representing these annonymous methods and wish to tests these dynamically based on selectable criteria.

+1  A: 

Take a look at this link.

Abe Miessler
Thank you for the pointer. The problem is that this link information does not describe how to do a runtime compile passing in a precompiled Object as <T>.
harryr