In c# I can use default(T)
to get the default value of a type. I need to get the default type at run time from a System.Type
. How can I do this?
E.g. Something along the lines of this (which doesn't work)
var type = typeof(int);
var defaultValue = default(type);