How to create an object of T using Reflection
suggest changeUsing the default constructor
T variable = Activator.CreateInstance(typeof(T));
Using parameterized constructor
T variable = Activator.CreateInstance(typeof(T), arg1, arg2);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents