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