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
Methods
Add(IConvention)
Adds the specified convention.
public void Add(IConvention convention)
Parameters
convention
IConventionThe convention.
Exceptions
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
stringThe 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
stringThe 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
stringThe 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
Append(IConventionPack)
Appends the conventions in another pack to the end of this pack.
public void Append(IConventionPack other)
Parameters
other
IConventionPackThe 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
stringThe name.
convention
IConventionThe convention.
InsertBefore(string, IConvention)
Inserts the convention before another convention specified by the name.
public void InsertBefore(string name, IConvention convention)
Parameters
name
stringThe name.
convention
IConventionThe convention.
Remove(string)
Removes the named convention.
public void Remove(string name)
Parameters
name
stringThe name of the convention.