I have Calss with Generic type.
I.E.
public calss EntMgr where T: EntityObject
{
public T Get() {
return context.CreateQuery(typeof(T).Name).ToList();
}
}
Now in I want to use that class from another class where I pass the Generectype as a string Value.
I.e.
public class Proxy{
public EntityObject Get(string entityObject)
{
Type type = Type.GetType(entityObject);
EntMgr emr = new EntMgr();
emr.get();
}
This doesn't work .
Is there a way to do something like that?
I know it is possible to work with "Activator"
But it creates unnecessary object.
Jean PaulPosted Nov 10, 2010, 8:44 AM
Can you please give the correct version and give a brief on the exact requirement?