Skip to main content
3 of 4
added cast to T
user287107
  • 9.4k
  • 1
  • 34
  • 47

You could use the activator class:

(T)Activator.CreateInstance(typeof(T), args) 
user287107
  • 9.4k
  • 1
  • 34
  • 47