public static object ChangeTypeForDefaultValue(object value, Type type, IFormatProvider formatProvider) { if (type == typeof(BigInteger)) { if ((DBNull.Value != value) && (value != null)) { return(BigIntegerStorage.ConvertToBigInteger(value, formatProvider)); } return(DBNull.Value); } if (value is BigInteger) { return(BigIntegerStorage.ConvertFromBigInteger((BigInteger)value, type, formatProvider)); } return(ChangeType2(value, DataStorage.GetStorageType(type), type, formatProvider)); }
// this should not be called for XmlSerialization public static object ChangeTypeForDefaultValue(object value, Type type, IFormatProvider formatProvider) { if (type == typeof(System.Numerics.BigInteger)) { if ((DBNull.Value == value) || (null == value)) { return(DBNull.Value); } return(BigIntegerStorage.ConvertToBigInteger(value, formatProvider)); } else if (value is System.Numerics.BigInteger) { return(BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)value, type, formatProvider)); } return(ChangeType2(value, DataStorage.GetStorageType(type), type, formatProvider)); }