Is it possible to defines the type of a Generic Class using a string variable ? I mean:
string myType = "System.string"
MyClass<myType> customClass = new MyClass<myType>();
I found some kind of examples but none of them works.
Many thanks in advance.
NOTE: Normally, those types are going to be numbers: float, int, double, ... I'm getting the type from a database to make generic and abstract the code.
I'm using this example: Is it possible to serialize a list of System.Object objects using protocol buffers
Then, my problem is with the type, I won't know which one is going to be, so, using this other example (@devNull): Pass An Instantiated System.Type as a Type Parameter for a Generic Class
I don't know how to tell to use the constructor with the argument instead of the empty one.