Table of Contents

Method ToBsonValue

Namespace
MongoDB.Bson.Serialization
Assembly
MongoDB.Bson.dll

ToBsonValue(IBsonSerializer, object)

Converts a value to a BsonValue by serializing it.

public static BsonValue ToBsonValue(this IBsonSerializer serializer, object value)

Parameters

serializer IBsonSerializer

The serializer.

value object

The value.

Returns

BsonValue

The serialized value.

ToBsonValue<TValue>(IBsonSerializer<TValue>, TValue)

Converts a value to a BsonValue by serializing it.

public static BsonValue ToBsonValue<TValue>(this IBsonSerializer<TValue> serializer, TValue value)

Parameters

serializer IBsonSerializer<TValue>

The serializer.

value TValue

The value.

Returns

BsonValue

The serialized value.

Type Parameters

TValue

The type of the value.