Table of Contents

Class BsonDocumentProjectionDefinition<TSource, TProjection>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

A BsonDocument based projection.

public sealed class BsonDocumentProjectionDefinition<TSource, TProjection> : ProjectionDefinition<TSource, TProjection>

Type Parameters

TSource

The type of the source.

TProjection

The type of the projection.

Inheritance
ProjectionDefinition<TSource, TProjection>
BsonDocumentProjectionDefinition<TSource, TProjection>
Inherited Members

Constructors

BsonDocumentProjectionDefinition(BsonDocument, IBsonSerializer<TProjection>)

Initializes a new instance of the BsonDocumentProjectionDefinition<TSource, TProjection> class.

public BsonDocumentProjectionDefinition(BsonDocument document, IBsonSerializer<TProjection> projectionSerializer = null)

Parameters

document BsonDocument

The document.

projectionSerializer IBsonSerializer<TProjection>

The projection serializer.

Properties

Document

Gets the document.

public BsonDocument Document { get; }

Property Value

BsonDocument

ProjectionSerializer

Gets the projection serializer.

public IBsonSerializer<TProjection> ProjectionSerializer { get; }

Property Value

IBsonSerializer<TProjection>

Methods

Render(IBsonSerializer<TSource>, IBsonSerializerRegistry, LinqProvider)

Renders the projection to a RenderedProjectionDefinition<TProjection>.

public override RenderedProjectionDefinition<TProjection> Render(IBsonSerializer<TSource> sourceSerializer, IBsonSerializerRegistry serializerRegistry, LinqProvider linqProvider)

Parameters

sourceSerializer IBsonSerializer<TSource>

The source serializer.

serializerRegistry IBsonSerializerRegistry

The serializer registry.

linqProvider LinqProvider

The LINQ provider.

Returns

RenderedProjectionDefinition<TProjection>

A RenderedProjectionDefinition<TProjection>.