I have an object myClassType of Type
string typeName = @"MyCompany.MyApp.MyDomain.MyClass"; Type myClassType = Type.GetType(typeName); and I want to create a lambda expression (similar to the one below), but how do I get the MyClass from the myClassType so that I can pass it to the Func
Expression.Lambda<Func<MyClass, bool>>() Is it possible to do so? any alternative ways or suggestions welcome.
myClassTypetype definition? Then useActivator.CreateInstance(myClassType)and cast it toMyClass. Notice there is an inconsistency: you have one type defined in two different ways: in string and in usual way as Type parameterExpression<Func<MyClass, bool>>or just aFunc<MyClass, bool>?