Table of Contents

Class ProjectionDefinition<TSource, TProjection>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Base class for projections.

public abstract class ProjectionDefinition<TSource, TProjection>

Type Parameters

TSource

The type of the source.

TProjection

The type of the projection.

Inheritance
ProjectionDefinition<TSource, TProjection>
Derived
Inherited Members

Methods

Render(IBsonSerializer<TSource>, IBsonSerializerRegistry)

Renders the projection to a RenderedProjectionDefinition<TProjection>.

public virtual RenderedProjectionDefinition<TProjection> Render(IBsonSerializer<TSource> sourceSerializer, IBsonSerializerRegistry serializerRegistry)

Parameters

sourceSerializer IBsonSerializer<TSource>

The source serializer.

serializerRegistry IBsonSerializerRegistry

The serializer registry.

Returns

RenderedProjectionDefinition<TProjection>

A RenderedProjectionDefinition<TProjection>.

Render(IBsonSerializer<TSource>, IBsonSerializerRegistry, LinqProvider)

Renders the projection to a RenderedProjectionDefinition<TProjection>.

public abstract 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>.

Operators

implicit operator ProjectionDefinition<TSource, TProjection>(BsonDocument)

Performs an implicit conversion from BsonDocument to ProjectionDefinition<TSource, TProjection>.

public static implicit operator ProjectionDefinition<TSource, TProjection>(BsonDocument document)

Parameters

document BsonDocument

The document.

Returns

ProjectionDefinition<TSource, TProjection>

The result of the conversion.

implicit operator ProjectionDefinition<TSource, TProjection>(ProjectionDefinition<TSource>)

public static implicit operator ProjectionDefinition<TSource, TProjection>(ProjectionDefinition<TSource> projection)

Parameters

projection ProjectionDefinition<TSource>

The projection.

Returns

ProjectionDefinition<TSource, TProjection>

The result of the conversion.

implicit operator ProjectionDefinition<TSource, TProjection>(string)

Performs an implicit conversion from string to ProjectionDefinition<TSource, TProjection>.

public static implicit operator ProjectionDefinition<TSource, TProjection>(string json)

Parameters

json string

The JSON string.

Returns

ProjectionDefinition<TSource, TProjection>

The result of the conversion.