Table of Contents

Class CreatorMapDelegateCompiler

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

A helper class used to create and compile delegates for creator maps.

public class CreatorMapDelegateCompiler : ExpressionVisitor
Inheritance
CreatorMapDelegateCompiler
Inherited Members
Extension Methods

Methods

CompileConstructorDelegate(ConstructorInfo)

Creates and compiles a delegate that calls a constructor.

public Delegate CompileConstructorDelegate(ConstructorInfo constructorInfo)

Parameters

constructorInfo ConstructorInfo

The constructor.

Returns

Delegate

A delegate that calls the constructor.

CompileCreatorDelegate<TClass>(Expression<Func<TClass, TClass>>, out IEnumerable<MemberInfo>)

Creates and compiles a delegate from a lambda expression.

public Delegate CompileCreatorDelegate<TClass>(Expression<Func<TClass, TClass>> creatorLambda, out IEnumerable<MemberInfo> arguments)

Parameters

creatorLambda Expression<Func<TClass, TClass>>

The lambda expression.

arguments IEnumerable<MemberInfo>

The arguments for the delegate's parameters.

Returns

Delegate

A delegate.

Type Parameters

TClass

The type of the class.

CompileFactoryMethodDelegate(MethodInfo)

Creates and compiles a delegate that calls a factory method.

public Delegate CompileFactoryMethodDelegate(MethodInfo methodInfo)

Parameters

methodInfo MethodInfo

the method.

Returns

Delegate

A delegate that calls the factory method.

VisitMember(MemberExpression)

Visits a MemberExpression.

protected override Expression VisitMember(MemberExpression node)

Parameters

node MemberExpression

The MemberExpression.

Returns

Expression

The MemberExpression (possibly modified).

VisitParameter(ParameterExpression)

Visits a ParameterExpression.

protected override Expression VisitParameter(ParameterExpression node)

Parameters

node ParameterExpression

The ParameterExpression.

Returns

Expression

The ParameterExpression (possibly modified).