Class BsonDouble
Represents a BSON double value.
[Serializable]
public class BsonDouble : BsonValue, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonDouble>, IEquatable<BsonDouble>
- Inheritance
-
BsonDouble
- Implements
- Inherited Members
- Extension Methods
Constructors
BsonDouble(double)
Initializes a new instance of the BsonDouble class.
public BsonDouble(double value)
Parameters
value
doubleThe value.
- See Also
Properties
BsonType
Gets the BsonType of this BsonValue.
public override BsonType BsonType { get; }
Property Value
- See Also
RawValue
Gets the raw value of this BsonValue (or null if this BsonValue doesn't have a single scalar value).
[Obsolete("Use Value instead.")]
public override object RawValue { get; }
Property Value
- See Also
Value
Gets the value of this BsonDouble.
public double Value { get; }
Property Value
- See Also
Methods
CompareTo(BsonDouble)
Compares this BsonDouble to another BsonDouble.
public int CompareTo(BsonDouble other)
Parameters
other
BsonDoubleThe other BsonDouble.
Returns
- int
A 32-bit signed integer that indicates whether this BsonDouble is less than, equal to, or greather than the other.
- See Also
CompareTo(BsonValue)
Compares this BsonValue to another BsonValue.
public override int CompareTo(BsonValue other)
Parameters
other
BsonValueThe other BsonValue.
Returns
- int
A 32-bit signed integer that indicates whether this BsonValue is less than, equal to, or greather than the other BsonValue.
- See Also
Create(object)
Creates a new instance of the BsonDouble class.
public static BsonDouble Create(object value)
Parameters
value
objectAn object to be mapped to a BsonDouble.
Returns
- BsonDouble
A BsonDouble.
- See Also
Equals(BsonDouble)
Compares this BsonDouble to another BsonDouble.
public bool Equals(BsonDouble rhs)
Parameters
rhs
BsonDoubleThe other BsonDouble.
Returns
- bool
True if the two BsonDouble values are equal.
- See Also
Equals(object)
Compares this BsonValue to another object.
public override bool Equals(object obj)
Parameters
obj
objectThe other object.
Returns
- bool
True if the other object is a BsonValue and equal to this one.
- See Also
GetHashCode()
Gets the hash code.
public override int GetHashCode()
Returns
- int
The hash code.
- See Also
IConvertibleGetTypeCodeImplementation()
Implementation of the IConvertible GetTypeCode method.
protected override TypeCode IConvertibleGetTypeCodeImplementation()
Returns
- TypeCode
The TypeCode.
- See Also
IConvertibleToBooleanImplementation(IFormatProvider)
Implementation of the IConvertible ToBoolean method.
protected override bool IConvertibleToBooleanImplementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- bool
A bool.
- See Also
IConvertibleToByteImplementation(IFormatProvider)
Implementation of the IConvertible ToByte method.
protected override byte IConvertibleToByteImplementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- byte
A byte.
- See Also
IConvertibleToDecimalImplementation(IFormatProvider)
Implementation of the IConvertible ToDecimal method.
protected override decimal IConvertibleToDecimalImplementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- decimal
A decimal.
- See Also
IConvertibleToDoubleImplementation(IFormatProvider)
Implementation of the IConvertible ToDouble method.
protected override double IConvertibleToDoubleImplementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- double
A double.
- See Also
IConvertibleToInt16Implementation(IFormatProvider)
Implementation of the IConvertible ToInt16 method.
protected override short IConvertibleToInt16Implementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- short
A short.
- See Also
IConvertibleToInt32Implementation(IFormatProvider)
Implementation of the IConvertible ToInt32 method.
protected override int IConvertibleToInt32Implementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- int
An int.
- See Also
IConvertibleToInt64Implementation(IFormatProvider)
Implementation of the IConvertible ToInt64 method.
protected override long IConvertibleToInt64Implementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- long
A long.
- See Also
IConvertibleToSByteImplementation(IFormatProvider)
Implementation of the IConvertible ToSByte method.
protected override sbyte IConvertibleToSByteImplementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- sbyte
An sbyte.
- See Also
IConvertibleToSingleImplementation(IFormatProvider)
Implementation of the IConvertible ToSingle method.
protected override float IConvertibleToSingleImplementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- float
A float.
- See Also
IConvertibleToStringImplementation(IFormatProvider)
Implementation of the IConvertible ToString method.
protected override string IConvertibleToStringImplementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- string
A string.
- See Also
IConvertibleToUInt16Implementation(IFormatProvider)
Implementation of the IConvertible ToUInt16 method.
protected override ushort IConvertibleToUInt16Implementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- ushort
A ushort.
- See Also
IConvertibleToUInt32Implementation(IFormatProvider)
Implementation of the IConvertible ToUInt32 method.
protected override uint IConvertibleToUInt32Implementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- uint
A uint.
- See Also
IConvertibleToUInt64Implementation(IFormatProvider)
Implementation of the IConvertible ToUInt64 method.
protected override ulong IConvertibleToUInt64Implementation(IFormatProvider provider)
Parameters
provider
IFormatProviderThe format provider.
Returns
- ulong
A ulong.
- See Also
OperatorEqualsImplementation(BsonValue)
Implementation of operator ==.
protected override bool OperatorEqualsImplementation(BsonValue rhs)
Parameters
rhs
BsonValueThe other BsonValue.
Returns
- bool
True if the two BsonValues are equal according to ==.
- See Also
ToBoolean()
Converts this BsonValue to a Boolean (using the JavaScript definition of truthiness).
public override bool ToBoolean()
Returns
- bool
A Boolean.
- See Also
ToDecimal()
Converts this BsonValue to a Decimal.
public override decimal ToDecimal()
Returns
- decimal
A Decimal.
- See Also
ToDecimal128()
Converts this BsonValue to a Decimal128.
public override Decimal128 ToDecimal128()
Returns
- Decimal128
A Decimal128.
- See Also
ToDouble()
Converts this BsonValue to a Double.
public override double ToDouble()
Returns
- double
A Double.
- See Also
ToInt32()
Converts this BsonValue to an Int32.
public override int ToInt32()
Returns
- int
An Int32.
- See Also
ToInt64()
Converts this BsonValue to an Int64.
public override long ToInt64()
Returns
- long
An Int64.
- See Also
ToString()
public override string ToString()
Returns
- See Also
Operators
operator ==(BsonDouble, BsonDouble)
Compares two BsonDouble values.
public static bool operator ==(BsonDouble lhs, BsonDouble rhs)
Parameters
lhs
BsonDoubleThe first BsonDouble.
rhs
BsonDoubleThe other BsonDouble.
Returns
- bool
True if the two BsonDouble values are equal according to ==.
- See Also
implicit operator BsonDouble(double)
Converts a double to a BsonDouble.
public static implicit operator BsonDouble(double value)
Parameters
value
doubleA double.
Returns
- BsonDouble
A BsonDouble.
- See Also
operator !=(BsonDouble, BsonDouble)
Compares two BsonDouble values.
public static bool operator !=(BsonDouble lhs, BsonDouble rhs)
Parameters
lhs
BsonDoubleThe first BsonDouble.
rhs
BsonDoubleThe other BsonDouble.
Returns
- bool
True if the two BsonDouble values are not equal according to ==.
- See Also