I\'m using reflection to loop through a Type\'s properties and set certain types to their default. Now, I could do a switch on the type and set the defau
Type
defau
Why do you say generics are out of the picture?
public static object GetDefault(Type t) { Func f = GetDefault; return f.Method.GetGenericMethodDefinition().MakeGenericMethod(t).Invoke(null, null); } private static T GetDefault() { return default(T); }