public static object GetDefaultValue(Type type) { if (!TypeHelpers.TypeAllowsNullValue(type)) { return(Activator.CreateInstance(type)); } else { return((object)null); } }
public static bool IsCompatibleObject <T>(object value) { if (value is T) { return(true); } if (value == null) { return(TypeHelpers.TypeAllowsNullValue(typeof(T))); } else { return(false); } }