Table of Contents

Class BsonInt64

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON long value.

[Serializable]
public class BsonInt64 : BsonValue, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonInt64>, IEquatable<BsonInt64>
Inheritance
BsonInt64
Implements
Inherited Members
Extension Methods

Constructors

BsonInt64(long)

Initializes a new instance of the BsonInt64 class.

public BsonInt64(long value)

Parameters

value long

The value.

Properties

BsonType

Gets the BsonType of this BsonValue.

public override BsonType BsonType { get; }

Property Value

BsonType

RawValue

Gets the BsonInt64 as a long.

[Obsolete("Use Value instead.")]
public override object RawValue { get; }

Property Value

object

Value

Gets the value of this BsonInt64.

public long Value { get; }

Property Value

long

Methods

CompareTo(BsonInt64)

Compares this BsonInt64 to another BsonInt64.

public int CompareTo(BsonInt64 other)

Parameters

other BsonInt64

The other BsonInt64.

Returns

int

A 32-bit signed integer that indicates whether this BsonInt64 is less than, equal to, or greather than the other.

CompareTo(BsonValue)

Compares the BsonInt64 to another BsonValue.

public override int CompareTo(BsonValue other)

Parameters

other BsonValue

The other BsonValue.

Returns

int

A 32-bit signed integer that indicates whether this BsonInt64 is less than, equal to, or greather than the other BsonValue.

Create(object)

Creates a new BsonInt64.

public static BsonInt64 Create(object value)

Parameters

value object

An object to be mapped to a BsonInt64.

Returns

BsonInt64

A BsonInt64 or null.

Equals(BsonInt64)

Compares this BsonInt64 to another BsonInt64.

public bool Equals(BsonInt64 rhs)

Parameters

rhs BsonInt64

The other BsonInt64.

Returns

bool

True if the two BsonInt64 values are equal.

Equals(object)

Compares this BsonInt64 to another object.

public override bool Equals(object obj)

Parameters

obj object

The other object.

Returns

bool

True if the other object is a BsonInt64 and equal to this one.

GetHashCode()

Gets the hash code.

public override int GetHashCode()

Returns

int

The hash code.

IConvertibleGetTypeCodeImplementation()

Implementation of the IConvertible GetTypeCode method.

protected override TypeCode IConvertibleGetTypeCodeImplementation()

Returns

TypeCode

The TypeCode.

IConvertibleToBooleanImplementation(IFormatProvider)

Implementation of the IConvertible ToBoolean method.

protected override bool IConvertibleToBooleanImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

bool

A bool.

IConvertibleToByteImplementation(IFormatProvider)

Implementation of the IConvertible ToByte method.

protected override byte IConvertibleToByteImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

byte

A byte.

IConvertibleToCharImplementation(IFormatProvider)

Implementation of the IConvertible ToChar method.

protected override char IConvertibleToCharImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

char

A char.

IConvertibleToDecimalImplementation(IFormatProvider)

Implementation of the IConvertible ToDecimal method.

protected override decimal IConvertibleToDecimalImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

decimal

A decimal.

IConvertibleToDoubleImplementation(IFormatProvider)

Implementation of the IConvertible ToDouble method.

protected override double IConvertibleToDoubleImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

double

A double.

IConvertibleToInt16Implementation(IFormatProvider)

Implementation of the IConvertible ToInt16 method.

protected override short IConvertibleToInt16Implementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

short

A short.

IConvertibleToInt32Implementation(IFormatProvider)

Implementation of the IConvertible ToInt32 method.

protected override int IConvertibleToInt32Implementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

int

An int.

IConvertibleToInt64Implementation(IFormatProvider)

Implementation of the IConvertible ToInt64 method.

protected override long IConvertibleToInt64Implementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

long

A long.

IConvertibleToSByteImplementation(IFormatProvider)

Implementation of the IConvertible ToSByte method.

protected override sbyte IConvertibleToSByteImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

sbyte

An sbyte.

IConvertibleToSingleImplementation(IFormatProvider)

Implementation of the IConvertible ToSingle method.

protected override float IConvertibleToSingleImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

float

A float.

IConvertibleToStringImplementation(IFormatProvider)

Implementation of the IConvertible ToString method.

protected override string IConvertibleToStringImplementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

string

A string.

IConvertibleToUInt16Implementation(IFormatProvider)

Implementation of the IConvertible ToUInt16 method.

protected override ushort IConvertibleToUInt16Implementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

ushort

A ushort.

IConvertibleToUInt32Implementation(IFormatProvider)

Implementation of the IConvertible ToUInt32 method.

protected override uint IConvertibleToUInt32Implementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

uint

A uint.

IConvertibleToUInt64Implementation(IFormatProvider)

Implementation of the IConvertible ToUInt64 method.

protected override ulong IConvertibleToUInt64Implementation(IFormatProvider provider)

Parameters

provider IFormatProvider

The format provider.

Returns

ulong

A ulong.

OperatorEqualsImplementation(BsonValue)

Compares this BsonInt32 against another BsonValue.

protected override bool OperatorEqualsImplementation(BsonValue rhs)

Parameters

rhs BsonValue

The other BsonValue.

Returns

bool

True if this BsonInt64 and the other BsonValue are equal according to ==.

ToBoolean()

Converts this BsonValue to a Boolean (using the JavaScript definition of truthiness).

public override bool ToBoolean()

Returns

bool

A Boolean.

ToDecimal()

Converts this BsonValue to a Decimal.

public override decimal ToDecimal()

Returns

decimal

A Decimal.

ToDecimal128()

Converts this BsonValue to a Decimal128.

public override Decimal128 ToDecimal128()

Returns

Decimal128

A Decimal128.

ToDouble()

Converts this BsonValue to a Double.

public override double ToDouble()

Returns

double

A Double.

ToInt32()

Converts this BsonValue to an Int32.

public override int ToInt32()

Returns

int

An Int32.

ToInt64()

Converts this BsonValue to an Int64.

public override long ToInt64()

Returns

long

An Int32.

ToString()

Returns a string representation of the value.

public override string ToString()

Returns

string

A string representation of the value.

Operators

operator ==(BsonInt64, BsonInt64)

Compares two BsonInt64 values.

public static bool operator ==(BsonInt64 lhs, BsonInt64 rhs)

Parameters

lhs BsonInt64

The first BsonInt64.

rhs BsonInt64

The other BsonInt64.

Returns

bool

True if the two BsonInt64 values are equal according to ==.

implicit operator BsonInt64(long)

Converts a long to a BsonInt64.

public static implicit operator BsonInt64(long value)

Parameters

value long

A long.

Returns

BsonInt64

A BsonInt64.

operator !=(BsonInt64, BsonInt64)

Compares two BsonInt64 values.

public static bool operator !=(BsonInt64 lhs, BsonInt64 rhs)

Parameters

lhs BsonInt64

The first BsonInt64.

rhs BsonInt64

The other BsonInt64.

Returns

bool

True if the two BsonInt64 values are not equal according to ==.