Table of Contents

Class ConventionPack

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

A mutable pack of conventions.

public class ConventionPack : IConventionPack, IEnumerable<IConvention>, IEnumerable
Inheritance
ConventionPack
Implements
Inherited Members
Extension Methods

Constructors

ConventionPack()

Initializes a new instance of the ConventionPack class.

public ConventionPack()

Properties

Conventions

Gets the conventions.

public IEnumerable<IConvention> Conventions { get; }

Property Value

IEnumerable<IConvention>

Methods

Add(IConvention)

Adds the specified convention.

public void Add(IConvention convention)

Parameters

convention IConvention

The convention.

Exceptions

ArgumentNullException

AddClassMapConvention(string, Action<BsonClassMap>)

Adds a class map convention created using the specified action upon a class map.

public void AddClassMapConvention(string name, Action<BsonClassMap> action)

Parameters

name string

The name of the convention.

action Action<BsonClassMap>

The action the convention should take upon the class map.

AddMemberMapConvention(string, Action<BsonMemberMap>)

Adds a member map convention created using the specified action upon a member map.

public void AddMemberMapConvention(string name, Action<BsonMemberMap> action)

Parameters

name string

The name of the convention.

action Action<BsonMemberMap>

The action the convention should take upon the member map.

AddPostProcessingConvention(string, Action<BsonClassMap>)

Adds a post processing convention created using the specified action upon a class map.

public void AddPostProcessingConvention(string name, Action<BsonClassMap> action)

Parameters

name string

The name of the convention.

action Action<BsonClassMap>

The action the convention should take upon the class map.

AddRange(IEnumerable<IConvention>)

Adds a range of conventions.

public void AddRange(IEnumerable<IConvention> conventions)

Parameters

conventions IEnumerable<IConvention>

The conventions.

Exceptions

ArgumentNullException

Append(IConventionPack)

Appends the conventions in another pack to the end of this pack.

public void Append(IConventionPack other)

Parameters

other IConventionPack

The other pack.

GetEnumerator()

Gets an enumerator for the conventions.

public IEnumerator<IConvention> GetEnumerator()

Returns

IEnumerator<IConvention>

An enumerator.

InsertAfter(string, IConvention)

Inserts the convention after another convention specified by the name.

public void InsertAfter(string name, IConvention convention)

Parameters

name string

The name.

convention IConvention

The convention.

InsertBefore(string, IConvention)

Inserts the convention before another convention specified by the name.

public void InsertBefore(string name, IConvention convention)

Parameters

name string

The name.

convention IConvention

The convention.

Remove(string)

Removes the named convention.

public void Remove(string name)

Parameters

name string

The name of the convention.