Table of Contents

Namespace MongoDB.Bson.Serialization.Conventions

The various conventions used during serialization/deserialization of BSON data are represented by the types in the MongoDB.Bson.Serialization.Conventions namespace.

Classes

AttributeConventionPack

Convention pack for applying attributes.

CamelCaseElementNameConvention

A convention that sets the element name the same as the member name with the first character lower cased.

ConventionBase

Base class for a convention.

ConventionPack

A mutable pack of conventions.

ConventionRegistry

Represents a registry of conventions.

ConventionRunner

Runs the conventions against a BsonClassMap and its BsonMemberMaps.

DefaultConventionPack

Convention pack of defaults.

DelegateClassMapConvention

A class map convention that wraps a delegate.

DelegateMemberMapConvention

A member map convention that wraps a delegate.

DelegatePostProcessingConvention

A post processing convention that wraps a delegate.

EnumRepresentationConvention

A convention that allows you to set the Enum serialization representation

HierarchicalDiscriminatorConvention

Represents a discriminator convention where the discriminator is an array of all the discriminators provided by the class maps of the root class down to the actual type.

IgnoreExtraElementsConvention

A convention that sets whether to ignore extra elements encountered during deserialization.

IgnoreIfDefaultConvention

A convention that sets whether to ignore default values during serialization.

IgnoreIfNullConvention

A convention that sets whether to ignore nulls during serialization.

ImmutableTypeClassMapConvention

Maps a fully immutable type. This will include anonymous types.

LookupIdGeneratorConvention

A convention that looks up an id generator for the id member.

MemberDefaultValueConvention

A convention that sets the default value for members of a given type.

MemberNameElementNameConvention

A convention that sets the element name the same as the member name.

NamedExtraElementsMemberConvention

A convention that finds the extra elements member by name (and that is also of type BsonDocument or IDictionary<TKey, TValue>).

NamedIdMemberConvention

A convention that finds the id member by name.

NamedParameterCreatorMapConvention

A convention that uses the names of the creator parameters to find the matching members.

NoIdMemberConvention

A convention that sets a class's IdMember to null.

ObjectDiscriminatorConvention

Represents the object discriminator convention.

ReadWriteMemberFinderConvention

A convention that finds readable and writeable members and adds them to the class map.

ResetClassMapConvention

A convention that resets a class map (resetting any changes that earlier conventions may have applied).

ResetMemberMapsConvention

A convention that resets class members (resetting any changes that earlier conventions may have applied).

ScalarDiscriminatorConvention

Represents a discriminator convention where the discriminator is provided by the class map of the actual type.

StandardDiscriminatorConvention

Represents the standard discriminator conventions (see ScalarDiscriminatorConvention and HierarchicalDiscriminatorConvention).

StringIdStoredAsObjectIdConvention

A convention that sets the representation of a string id class member to ObjectId in BSON with a StringObjectIdGenerator. This convention is only responsible for setting the serializer and idGenerator. It is assumed that this convention runs after other conventions that identify which member is the _id and that the _id has already been added to the class map.

StringObjectIdIdGeneratorConvention

A convention that sets the id generator for a string member with a BSON representation of ObjectId.

Interfaces

IClassMapConvention

Represents a convention that applies to a BsonClassMap.

IConvention

Represents a convention.

IConventionPack

Represents a grouping of conventions.

ICreatorMapConvention

Represents a convention that applies to a BsonCreatorMap.

IDiscriminatorConvention

Represents a discriminator convention.

IHierarchicalDiscriminatorConvention

Represents a discriminator convention where the discriminator for each type in a polymorphic hierarchy is an array representing the hierarchy.

IMemberMapConvention

Represents a convention that applies to a BsonMemberMap.

IPostProcessingConvention

Represents a post processing convention that applies to a BsonClassMap.

IScalarDiscriminatorConvention

Represents a discriminator convention where the discriminator for each type in a polymorphic hierarchy is a scalar.