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
IBsonSerializerThe serializer.
value
objectThe 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
TValueThe value.
Returns
- BsonValue
The serialized value.
Type Parameters
TValue
The type of the value.