Table of Contents

Class ExpressionFieldDefinition<TDocument, TField>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

An Expression based field.

public sealed class ExpressionFieldDefinition<TDocument, TField> : FieldDefinition<TDocument, TField>

Type Parameters

TDocument

The type of the document.

TField

The type of the field.

Inheritance
FieldDefinition<TDocument, TField>
ExpressionFieldDefinition<TDocument, TField>
Inherited Members

Constructors

ExpressionFieldDefinition(Expression<Func<TDocument, TField>>)

Initializes a new instance of the ExpressionFieldDefinition<TDocument, TField> class.

public ExpressionFieldDefinition(Expression<Func<TDocument, TField>> expression)

Parameters

expression Expression<Func<TDocument, TField>>

The expression.

Properties

Expression

Gets the expression.

public Expression<Func<TDocument, TField>> Expression { get; }

Property Value

Expression<Func<TDocument, TField>>

Methods

Render(IBsonSerializer<TDocument>, IBsonSerializerRegistry, LinqProvider)

Renders the field to a RenderedFieldDefinition<TField>.

public override RenderedFieldDefinition<TField> Render(IBsonSerializer<TDocument> documentSerializer, IBsonSerializerRegistry serializerRegistry, LinqProvider linqProvider)

Parameters

documentSerializer IBsonSerializer<TDocument>

The document serializer.

serializerRegistry IBsonSerializerRegistry

The serializer registry.

linqProvider LinqProvider

The LINQ provider.

Returns

RenderedFieldDefinition<TField>

A RenderedFieldDefinition<TField>.

Render(IBsonSerializer<TDocument>, IBsonSerializerRegistry, LinqProvider, bool)

Renders the field to a RenderedFieldDefinition<TField>.

public override RenderedFieldDefinition<TField> Render(IBsonSerializer<TDocument> documentSerializer, IBsonSerializerRegistry serializerRegistry, LinqProvider linqProvider, bool allowScalarValueForArrayField)

Parameters

documentSerializer IBsonSerializer<TDocument>

The document serializer.

serializerRegistry IBsonSerializerRegistry

The serializer registry.

linqProvider LinqProvider

The LINQ provider.

allowScalarValueForArrayField bool

Whether a scalar value is allowed for an array field.

Returns

RenderedFieldDefinition<TField>

A RenderedFieldDefinition<TField>.