26 instantiations of SqlMoney
System.Data.Common (26)
System\Data\Common\SQLConvert.cs (1)
593return new SqlMoney(XmlConvert.ToDecimal((string)value));
System\Data\SQLTypes\SQLMoney.cs (25)
179return new SqlMoney(x); 185return new SqlMoney(x); 191return new SqlMoney(new decimal(x)); 247money = new SqlMoney(d); 251money = new SqlMoney(decimal.Parse(s, NumberStyles.Currency, NumberFormatInfo.CurrentInfo)); 264return new SqlMoney(value, 0); 274return new SqlMoney(-x._value, 0); 285return (x.IsNull || y.IsNull) ? Null : new SqlMoney(checked(x._value + y._value), 0); 297return (x.IsNull || y.IsNull) ? Null : new SqlMoney(checked(x._value - y._value), 0); 308new SqlMoney(decimal.Multiply(x.ToDecimal(), y.ToDecimal())); 314new SqlMoney(decimal.Divide(x.ToDecimal(), y.ToDecimal())); 323return x.IsNull ? Null : new SqlMoney(x.ByteValue); 329return x.IsNull ? Null : new SqlMoney(x.Value); 335return x.IsNull ? Null : new SqlMoney(x.Value); 341return x.IsNull ? Null : new SqlMoney(x.Value); 347return x.IsNull ? Null : new SqlMoney(x.Value); 356return x.IsNull ? Null : new SqlMoney(x.Value); 362return x.IsNull ? Null : new SqlMoney(x.Value); 368return x.IsNull ? SqlMoney.Null : new SqlMoney(x.Value); 375return x.IsNull ? Null : new SqlMoney(decimal.Parse(x.Value, NumberStyles.Currency, null)); 583SqlMoney money = new SqlMoney(XmlConvert.ToDecimal(reader.ReadElementString())); 611public static readonly SqlMoney Null = new SqlMoney(true); 617public static readonly SqlMoney Zero = new SqlMoney(0); 625public static readonly SqlMoney MinValue = new SqlMoney(unchecked((long)0x8000000000000000L), 0); 633public static readonly SqlMoney MaxValue = new SqlMoney(0x7FFFFFFFFFFFFFFFL, 0);
152 references to SqlMoney
netstandard (1)
netstandard.cs (1)
586[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlMoney))]
System.Data (1)
src\libraries\shims\System.Data\ref\System.Data.cs (1)
243[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.SqlTypes.SqlMoney))]
System.Data.Common (150)
System\Data\ColumnTypeConverter.cs (1)
50typeof(SqlMoney),
System\Data\Common\DataStorage.cs (1)
107typeof(SqlMoney),
System\Data\Common\SQLConvert.cs (8)
124StorageType.SqlMoney => (SqlMoney)value, 155StorageType.SqlMoney => (SqlMoney)value, 185StorageType.SqlMoney => (SqlMoney)value, 191public static SqlMoney ConvertToSqlMoney(object value) 196return SqlMoney.Null; 203StorageType.SqlMoney => (SqlMoney)value, 216_ => throw ExceptionBuilder.ConvertFailed(valueType, typeof(SqlMoney)), 681return XmlConvert.ToString(((SqlMoney)value).Value);
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (20)
16private SqlMoney[] _values = default!; // Late-initialized 19: base(column, typeof(SqlMoney), SqlMoney.Null, SqlMoney.Null, StorageType.SqlMoney) 58SqlMoney mean = 0; 104SqlMoney min = SqlMoney.MaxValue; 110if ((SqlMoney.LessThan(_values[record], min)).IsTrue) 121SqlMoney max = SqlMoney.MinValue; 127if ((SqlMoney.GreaterThan(_values[record], max)).IsTrue) 156throw ExprException.Overflow(typeof(SqlMoney)); 169return _values[recordNo].CompareTo((SqlMoney)value); 210SqlMoney newValue = default; 220return ((SqlMoney)tmp); 228Debug.Assert((value.GetType() == typeof(SqlMoney)), "wrong input type"); 241return new SqlMoney[recordCount]; 246SqlMoney[] typedStore = (SqlMoney[])store; 253_values = (SqlMoney[])store;
System\Data\Filter\UnaryNode.cs (1)
106value = -(SqlMoney)vl;
System\Data\SQLTypes\SQLBoolean.cs (4)
272public static explicit operator SqlBoolean(SqlMoney x) 274return x.IsNull ? Null : (x != SqlMoney.Zero); 413public SqlMoney ToSqlMoney() 415return (SqlMoney)this;
System\Data\SQLTypes\SQLByte.cs (2)
187public static explicit operator SqlByte(SqlMoney x) 422public SqlMoney ToSqlMoney()
System\Data\SQLTypes\SQLDecimal.cs (3)
1778public static implicit operator SqlDecimal(SqlMoney x) 3008public SqlMoney ToSqlMoney() 3010return (SqlMoney)this;
System\Data\SQLTypes\SQLDouble.cs (3)
196public static implicit operator SqlDouble(SqlMoney x) 340public SqlMoney ToSqlMoney() 342return (SqlMoney)this;
System\Data\SQLTypes\SQLInt16.cs (2)
252public static explicit operator SqlInt16(SqlMoney x) 425public SqlMoney ToSqlMoney()
System\Data\SQLTypes\SQLInt32.cs (2)
248public static explicit operator SqlInt32(SqlMoney x) 440public SqlMoney ToSqlMoney()
System\Data\SQLTypes\SQLInt64.cs (2)
290public static explicit operator SqlInt64(SqlMoney x) 499public SqlMoney ToSqlMoney()
System\Data\SQLTypes\SQLMoney.cs (93)
24public struct SqlMoney : INullable, IComparable, IXmlSerializable, IEquatable<SqlMoney> 56/// Initializes a new instance of the <see cref='SqlMoney'/> class with the value given. 65/// Initializes a new instance of the <see cref='SqlMoney'/> class with the value given. 76/// Initializes a new instance of the <see cref='SqlMoney'/> class with the value given. 99/// Initializes a new instance of the <see cref='SqlMoney'/> class with the value given. 116/// Gets or sets the monetary value of an instance of the <see cref='SqlMoney'/> class. 177public static implicit operator SqlMoney(decimal x) 183public static explicit operator SqlMoney(double x) 189public static implicit operator SqlMoney(long x) 195public static explicit operator decimal(SqlMoney x) 212/// Gets the TDS (Tabular Data Stream) representation of this <see cref="SqlMoney" /> value. 215/// <exception cref="SqlNullValueException">Thrown when the <see cref="SqlMoney" /> is <see langword="null" />.</exception> 224public static SqlMoney Parse(string s) 230SqlMoney money; 243money = SqlMoney.Null; 258/// Creates a <see cref="SqlMoney" /> from a TDS (Tabular Data Stream) value. 260/// <param name="value">The TDS value to convert to <see cref="SqlMoney" />.</param> 261/// <returns>A <see cref="SqlMoney" /> representing the TDS value.</returns> 262public static SqlMoney FromTdsValue(long value) 268public static SqlMoney operator -(SqlMoney x) 281public static SqlMoney operator +(SqlMoney x, SqlMoney y) 293public static SqlMoney operator -(SqlMoney x, SqlMoney y) 305public static SqlMoney operator *(SqlMoney x, SqlMoney y) 311public static SqlMoney operator /(SqlMoney x, SqlMoney y) 321public static explicit operator SqlMoney(SqlBoolean x) 327public static implicit operator SqlMoney(SqlByte x) 333public static implicit operator SqlMoney(SqlInt16 x) 339public static implicit operator SqlMoney(SqlInt32 x) 345public static implicit operator SqlMoney(SqlInt64 x) 354public static explicit operator SqlMoney(SqlSingle x) 360public static explicit operator SqlMoney(SqlDouble x) 366public static explicit operator SqlMoney(SqlDecimal x) 368return x.IsNull ? SqlMoney.Null : new SqlMoney(x.Value); 373public static explicit operator SqlMoney(SqlString x) 382public static SqlBoolean operator ==(SqlMoney x, SqlMoney y) 387public static SqlBoolean operator !=(SqlMoney x, SqlMoney y) 392public static SqlBoolean operator <(SqlMoney x, SqlMoney y) 397public static SqlBoolean operator >(SqlMoney x, SqlMoney y) 402public static SqlBoolean operator <=(SqlMoney x, SqlMoney y) 407public static SqlBoolean operator >=(SqlMoney x, SqlMoney y) 418public static SqlMoney Add(SqlMoney x, SqlMoney y) 423public static SqlMoney Subtract(SqlMoney x, SqlMoney y) 429public static SqlMoney Multiply(SqlMoney x, SqlMoney y) 435public static SqlMoney Divide(SqlMoney x, SqlMoney y) 441public static SqlBoolean Equals(SqlMoney x, SqlMoney y) 447public static SqlBoolean NotEquals(SqlMoney x, SqlMoney y) 453public static SqlBoolean LessThan(SqlMoney x, SqlMoney y) 459public static SqlBoolean GreaterThan(SqlMoney x, SqlMoney y) 465public static SqlBoolean LessThanOrEqual(SqlMoney x, SqlMoney y) 471public static SqlBoolean GreaterThanOrEqual(SqlMoney x, SqlMoney y) 533if (value is SqlMoney i) 537throw ADP.WrongType(value!.GetType(), typeof(SqlMoney)); 540public int CompareTo(SqlMoney value) 556value is SqlMoney other && Equals(other); 561public bool Equals(SqlMoney other) => 583SqlMoney money = new SqlMoney(XmlConvert.ToDecimal(reader.ReadElementString())); 609/// the <see cref='SqlMoney'/>class. 611public static readonly SqlMoney Null = new SqlMoney(true); 615/// the <see cref='SqlMoney'/> class. 617public static readonly SqlMoney Zero = new SqlMoney(0); 622/// the <see cref='SqlMoney'/> 625public static readonly SqlMoney MinValue = new SqlMoney(unchecked((long)0x8000000000000000L), 0); 630/// the <see cref='SqlMoney'/> 633public static readonly SqlMoney MaxValue = new SqlMoney(0x7FFFFFFFFFFFFFFFL, 0);
System\Data\SQLTypes\SQLSingle.cs (3)
197public static implicit operator SqlSingle(SqlMoney x) 354public SqlMoney ToSqlMoney() 356return (SqlMoney)this;
System\Data\SQLTypes\SQLString.cs (3)
506public static explicit operator SqlString(SqlMoney x) 653public SqlMoney ToSqlMoney() 655return (SqlMoney)this;
System\Data\TypeLimiter.cs (1)
163typeof(SqlMoney),
System\Data\xmlsaver.cs (1)
239if (type == typeof(decimal) || type == typeof(SqlDecimal) || type == typeof(SqlMoney))