Table of Contents

Operator implicit operator

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

implicit operator BsonValue(bool)

Converts a bool to a BsonValue.

public static implicit operator BsonValue(bool value)

Parameters

value bool

A bool.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(bool?)

Converts a bool? to a BsonValue.

public static implicit operator BsonValue(bool? value)

Parameters

value bool?

A bool?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(byte[])

Converts a byte[] to a BsonValue.

public static implicit operator BsonValue(byte[] value)

Parameters

value byte[]

A byte[].

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(DateTime)

Converts a DateTime to a BsonValue.

public static implicit operator BsonValue(DateTime value)

Parameters

value DateTime

A DateTime.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(DateTime?)

Converts a DateTime? to a BsonValue.

public static implicit operator BsonValue(DateTime? value)

Parameters

value DateTime?

A DateTime?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(decimal)

Converts a decimal to a BsonValue.

public static implicit operator BsonValue(decimal value)

Parameters

value decimal

A decimal.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(decimal?)

Converts a decimal? to a BsonValue.

public static implicit operator BsonValue(decimal? value)

Parameters

value decimal?

A decimal?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(Decimal128)

Converts a Decimal128 to a BsonValue.

public static implicit operator BsonValue(Decimal128 value)

Parameters

value Decimal128

A Decimal128.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(Decimal128?)

Converts a nullable Decimal128 to a BsonValue.

public static implicit operator BsonValue(Decimal128? value)

Parameters

value Decimal128?

A Decimal128?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(double)

Converts a double to a BsonValue.

public static implicit operator BsonValue(double value)

Parameters

value double

A double.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(double?)

Converts a double? to a BsonValue.

public static implicit operator BsonValue(double? value)

Parameters

value double?

A double?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(Enum)

Converts an Enum to a BsonValue.

public static implicit operator BsonValue(Enum value)

Parameters

value Enum

An Enum.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(Guid)

Converts a Guid to a BsonValue.

[Obsolete("Use the BsonBinaryData constructor instead and specify a Guid representation.")]
public static implicit operator BsonValue(Guid value)

Parameters

value Guid

A Guid.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(Guid?)

Converts a Guid? to a BsonValue.

[Obsolete("Use the BsonBinaryData constructor instead and specify a Guid representation.")]
public static implicit operator BsonValue(Guid? value)

Parameters

value Guid?

A Guid?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(int)

Converts an int to a BsonValue.

public static implicit operator BsonValue(int value)

Parameters

value int

An int.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(int?)

Converts an int? to a BsonValue.

public static implicit operator BsonValue(int? value)

Parameters

value int?

An int?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(long)

Converts a long to a BsonValue.

public static implicit operator BsonValue(long value)

Parameters

value long

A long.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(long?)

Converts a long? to a BsonValue.

public static implicit operator BsonValue(long? value)

Parameters

value long?

A long?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(ObjectId)

Converts an ObjectId to a BsonValue.

public static implicit operator BsonValue(ObjectId value)

Parameters

value ObjectId

An ObjectId.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(ObjectId?)

Converts an ObjectId? to a BsonValue.

public static implicit operator BsonValue(ObjectId? value)

Parameters

value ObjectId?

An ObjectId?.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(Regex)

Converts a Regex to a BsonValue.

public static implicit operator BsonValue(Regex value)

Parameters

value Regex

A Regex.

Returns

BsonValue

A BsonValue.

implicit operator BsonValue(string)

Converts a string to a BsonValue.

public static implicit operator BsonValue(string value)

Parameters

value string

A string.

Returns

BsonValue

A BsonValue.