BsonClassMap ClassMongoDB C# Driver API Documentation
Represents a mapping between a class and a BSON document.
Inheritance Hierarchy

SystemObject
  MongoDB.Bson.SerializationBsonClassMap
    MongoDB.Bson.SerializationBsonClassMapTClass

Namespace: MongoDB.Bson.Serialization
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: { version: '1.11.0.92', semver: '1.11.0', commit: '791a16588d4a8b3b118a8b3b57cfa436fec5d3da', commitDate: '2015-12-08 22:55:45' }
Syntax

public abstract class BsonClassMap

The BsonClassMap type exposes the following members.

Constructors

  NameDescription
Protected methodBsonClassMap
Initializes a new instance of the BsonClassMap class.
Top
Methods

  NameDescription
Public methodAddKnownType
Adds a known type to the class map.
Public methodAutoMap
Automaps the class.
Public methodCreateInstance
Creates an instance of the class.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFreeze
Freezes the class map.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberGetMemberInfoType
Gets the type of a member.
Public methodGetMemberMap
Gets a member map (only considers members declared in this class).
Public methodGetMemberMapForElement
Gets the member map for a BSON element.
Public methodStatic memberGetRegisteredClassMaps
Gets all registered class maps.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodStatic memberIsClassMapRegistered
Checks whether a class map is registered for a type.
Public methodStatic memberLookupClassMap
Looks up a class map (will AutoMap the class if no class map is registered).
Public methodStatic memberLookupConventions Obsolete.
Looks up the conventions profile for a type.
Public methodMapConstructor(ConstructorInfo)
Creates a creator map for a constructor and adds it to the class map.
Public methodMapConstructor(ConstructorInfo, String)
Creates a creator map for a constructor and adds it to the class map.
Public methodMapCreator(Delegate)
Creates a creator map and adds it to the class.
Public methodMapCreator(Delegate, String)
Creates a creator map and adds it to the class.
Public methodMapExtraElementsField
Creates a member map for the extra elements field and adds it to the class map.
Public methodMapExtraElementsMember
Creates a member map for the extra elements member and adds it to the class map.
Public methodMapExtraElementsProperty
Creates a member map for the extra elements property and adds it to the class map.
Public methodMapFactoryMethod(MethodInfo)
Creates a creator map for a factory method and adds it to the class.
Public methodMapFactoryMethod(MethodInfo, String)
Creates a creator map for a factory method and adds it to the class.
Public methodMapField
Creates a member map for a field and adds it to the class map.
Public methodMapIdField
Creates a member map for the Id field and adds it to the class map.
Public methodMapIdMember
Creates a member map for the Id member and adds it to the class map.
Public methodMapIdProperty
Creates a member map for the Id property and adds it to the class map.
Public methodMapMember
Creates a member map for a member and adds it to the class map.
Public methodMapProperty
Creates a member map for a property and adds it to the class map.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberRegisterClassMap(BsonClassMap)
Registers a class map.
Public methodStatic memberRegisterClassMapTClass
Creates and registers a class map.
Public methodStatic memberRegisterClassMapTClass(ActionBsonClassMapTClass)
Creates and registers a class map.
Public methodStatic memberRegisterConventions Obsolete.
Registers a conventions profile.
Public methodReset
Resets the class map back to its initial state.
Public methodSetCreator
Sets the creator for the object.
Public methodSetDiscriminator
Sets the discriminator.
Public methodSetDiscriminatorIsRequired
Sets whether a discriminator is required when serializing this class.
Public methodSetExtraElementsMember
Sets the member map of the member used to hold extra elements.
Public methodSetIdMember
Sets the Id member.
Public methodSetIgnoreExtraElements
Sets whether extra elements should be ignored when deserializing.
Public methodSetIgnoreExtraElementsIsInherited
Sets whether the IgnoreExtraElements value should be inherited by derived classes.
Public methodSetIsRootClass
Sets whether this class is a root class.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnmapConstructor
Removes a creator map for a constructor from the class map.
Public methodUnmapFactoryMethod
Removes a creator map for a factory method from the class map.
Public methodUnmapField
Removes the member map for a field from the class map.
Public methodUnmapMember
Removes a member map from the class map.
Public methodUnmapProperty
Removes the member map for a property from the class map.
Top
Extension Methods

  NameDescription
Public Extension MethodToBson(Type)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
Properties

  NameDescription
Public propertyAllMemberMaps
Gets all the member maps (including maps for inherited members).
Public propertyBaseClassMap
Gets the base class map.
Public propertyClassType
Gets the class type.
Public propertyConventionPack
Gets the conventions used for auto mapping.
Public propertyConventions Obsolete.
Gets the conventions used with this class.
Public propertyCreatorMaps
Gets the constructor maps.
Public propertyDeclaredMemberMaps
Gets the declared member maps (only for members declared in this class).
Public propertyDiscriminator
Gets the discriminator.
Public propertyDiscriminatorIsRequired
Gets whether a discriminator is required when serializing this class.
Public propertyExtraElementsMemberMap
Gets the member map of the member used to hold extra elements.
Public propertyHasCreatorMaps
Gets whether this class map has any creator maps.
Public propertyHasRootClass
Gets whether this class has a root class ancestor.
Public propertyIdMemberMap
Gets the Id member map (null if none).
Public propertyIgnoreExtraElements
Gets whether extra elements should be ignored when deserializing.
Public propertyIgnoreExtraElementsIsInherited
Gets whether the IgnoreExtraElements value should be inherited by derived classes.
Public propertyIsAnonymous
Gets whether this class is anonymous.
Public propertyIsFrozen
Gets whether the class map is frozen.
Public propertyIsRootClass
Gets whether this class is a root class.
Public propertyKnownTypes
Gets the known types of this class.
Top
See Also

Reference