1public static object Default(this Type type) 2{ 3 if(type.IsValueType) 4 { 5 return Activator.CreateInstance(type); 6 } 7 return null; 8} 9