Class BsonCreatorMap
- Namespace
- MongoDB.Bson.Serialization
- Assembly
- MongoDB.Bson.dll
Represents a mapping to a delegate and its arguments.
public class BsonCreatorMap
- Inheritance
-
BsonCreatorMap
- Inherited Members
- Extension Methods
Constructors
BsonCreatorMap(BsonClassMap, MemberInfo, Delegate)
Initializes a new instance of the BsonCreatorMap class.
public BsonCreatorMap(BsonClassMap classMap, MemberInfo memberInfo, Delegate @delegate)
Parameters
classMap
BsonClassMapThe class map.
memberInfo
MemberInfoThe member info (null if none).
delegate
DelegateThe delegate.
Properties
Arguments
Gets the arguments.
public IEnumerable<MemberInfo> Arguments { get; }
Property Value
ClassMap
Gets the class map that this creator map belongs to.
public BsonClassMap ClassMap { get; }
Property Value
Delegate
Gets the delegeate
public Delegate Delegate { get; }
Property Value
ElementNames
Gets the element names.
public IEnumerable<string> ElementNames { get; }
Property Value
MemberInfo
Gets the member info (null if none).
public MemberInfo MemberInfo { get; }
Property Value
Methods
Freeze()
Freezes the creator map.
public void Freeze()
HasDefaultValue(string)
Gets whether there is a default value for a missing element.
public bool HasDefaultValue(string elementName)
Parameters
elementName
stringThe element name.
Returns
- bool
True if there is a default value for element name; otherwise, false.
SetArguments(IEnumerable<MemberInfo>)
Sets the arguments for the creator map.
public BsonCreatorMap SetArguments(IEnumerable<MemberInfo> arguments)
Parameters
arguments
IEnumerable<MemberInfo>The arguments.
Returns
- BsonCreatorMap
The creator map.
SetArguments(IEnumerable<string>)
Sets the arguments for the creator map.
public BsonCreatorMap SetArguments(IEnumerable<string> argumentNames)
Parameters
argumentNames
IEnumerable<string>The argument names.
Returns
- BsonCreatorMap
The creator map.