i got a class like
class Btree<T> where T : IComparable { }
Now i want to write a controller that depending on the input creates an object. But i don't want to rewrite the code for all possible types. So i need something like:
Btree t = null;
if(input == "int")
t = new Btree<int>();
if(input == "string")
t = new Btree<string>();
After that i want to treat t no matter what type the btree actually is. Is this somehow possible?