Table of Contents

Interface IBsonIdProvider

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

Contract for serializers that can get and set Id values.

public interface IBsonIdProvider
Extension Methods

Methods

GetDocumentId(object, out object, out Type, out IIdGenerator)

Gets the document Id.

bool GetDocumentId(object document, out object id, out Type idNominalType, out IIdGenerator idGenerator)

Parameters

document object

The document.

id object

The Id.

idNominalType Type

The nominal type of the Id.

idGenerator IIdGenerator

The IdGenerator for the Id type.

Returns

bool

True if the document has an Id.

SetDocumentId(object, object)

Sets the document Id.

void SetDocumentId(object document, object id)

Parameters

document object

The document.

id object

The Id.