I need to create a generic object based on a type that is stored in a database. How can I acheive this? The code below (which won't compile) explains what I mean:
string typeString = GetTypeFromDatabase(key);
Type objectType = Type.GetType(typeString);
//This won't work, but you get the idea!
MyObject<objectType> myobject = new MyObject<objectType>();
Is it possible to do this kind of thing?
Thanks