Method Constant
Constant<TValue>(TValue, IBsonSerializer<TValue>)
Use this method in a MongoDB LINQ query when you need to specify how a constant should be serialized.
public static TValue Constant<TValue>(TValue value, IBsonSerializer<TValue> serializer)
Parameters
value
TValueThe value.
serializer
IBsonSerializer<TValue>The serializer.
Returns
- TValue
The value.
Type Parameters
TValue
The type of the value.
Constant<TValue>(TValue, BsonType)
Use this method in a MongoDB LINQ query when you need to specify how a constant should be serialized.
public static TValue Constant<TValue>(TValue value, BsonType representaion)
Parameters
value
TValueThe value.
representaion
BsonTypeThe representation.
Returns
- TValue
The value
Type Parameters
TValue
The type of the value.