public static object GetDefaultValue(System.Type type) { if (type.IsValueType) return Activator.CreateInstance(type); else return null; }