Method Constant

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

Constant(TValue, IBsonSerializer)

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 TValue

The value.

serializer IBsonSerializer

The serializer.

Returns

TValue

The value.

Type Parameters

TValue

The type of the value.

Constant(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 TValue

The value.

representaion BsonType

The representation.

Returns

TValue

The value

Type Parameters

TValue

The type of the value.