G
GeezerButler
For any given type i want to know its default value.
There is a neat keyword called default for doing this like
object x = default(DateTime);
but I have an instance of Type (called someType) and something like
this cant work
object x = default(someType);
Is there any nice way of doing this? I dont really want to write a
huge switch block enumerating all types in .NET !
There is a neat keyword called default for doing this like
object x = default(DateTime);
but I have an instance of Type (called someType) and something like
this cant work
object x = default(someType);
Is there any nice way of doing this? I dont really want to write a
huge switch block enumerating all types in .NET !