C# Класс MongoDB.Bson.Serialization.BsonMemberMap

Represents the mapping between a field or property and a BSON element.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ApplyDefaultValue ( object obj ) : void

Applies the default value to the member of an object.

BsonMemberMap ( BsonClassMap classMap, MemberInfo memberInfo ) : System

Initializes a new instance of the BsonMemberMap class.

Freeze ( ) : void

Freezes this instance.

GetSerializer ( Type actualType ) : IBsonSerializer

Gets the serializer.

Reset ( ) : BsonMemberMap

Resets the member map back to its initial state.

SetDefaultValue ( Func defaultValueCreator ) : BsonMemberMap

Sets the default value creator.

SetDefaultValue ( object defaultValue ) : BsonMemberMap

Sets the default value.

SetElementName ( string elementName ) : BsonMemberMap

Sets the name of the element.

SetIdGenerator ( IIdGenerator idGenerator ) : BsonMemberMap

Sets the Id generator.

SetIgnoreIfDefault ( bool ignoreIfDefault ) : BsonMemberMap

Sets whether default values should be ignored when serialized.

SetIgnoreIfNull ( bool ignoreIfNull ) : BsonMemberMap

Sets whether null values should be ignored when serialized.

SetIsRequired ( bool isRequired ) : BsonMemberMap

Sets whether an element is required for this member when deserialized

SetOrder ( int order ) : BsonMemberMap

Sets the serialization order.

SetRepresentation ( BsonType representation ) : BsonMemberMap

Sets the external representation.

SetSerializationOptions ( IBsonSerializationOptions serializationOptions ) : BsonMemberMap

Sets the serialization options.

SetSerializer ( IBsonSerializer serializer ) : BsonMemberMap

Sets the serializer.

SetShouldSerializeMethod ( bool>.Func shouldSerializeMethod ) : BsonMemberMap

Sets the method that will be called to determine whether the member should be serialized.

ShouldSerialize ( object obj, object value ) : bool

Determines whether a value should be serialized

Приватные методы

Метод Описание
GetDefaultValue ( Type type ) : object
GetDiscriminatorConvention ( ) : IDiscriminatorConvention

Gets the discriminator convention for the member type.

GetFieldSetter ( ) : object>.Action
GetGetter ( ) : object>.Func
GetPropertySetter ( ) : object>.Action
ThrowFrozenException ( ) : void

Описание методов

ApplyDefaultValue() публичный метод

Applies the default value to the member of an object.
public ApplyDefaultValue ( object obj ) : void
obj object The object.
Результат void

BsonMemberMap() публичный метод

Initializes a new instance of the BsonMemberMap class.
public BsonMemberMap ( BsonClassMap classMap, MemberInfo memberInfo ) : System
classMap BsonClassMap The class map this member map belongs to.
memberInfo System.Reflection.MemberInfo The member info.
Результат System

Freeze() публичный метод

Freezes this instance.
public Freeze ( ) : void
Результат void

GetSerializer() публичный метод

Gets the serializer.
public GetSerializer ( Type actualType ) : IBsonSerializer
actualType System.Type The actual type of the member's value.
Результат IBsonSerializer

Reset() публичный метод

Resets the member map back to its initial state.
public Reset ( ) : BsonMemberMap
Результат BsonMemberMap

SetDefaultValue() публичный метод

Sets the default value creator.
public SetDefaultValue ( Func defaultValueCreator ) : BsonMemberMap
defaultValueCreator Func The default value creator (note: the supplied delegate must be thread safe).
Результат BsonMemberMap

SetDefaultValue() публичный метод

Sets the default value.
public SetDefaultValue ( object defaultValue ) : BsonMemberMap
defaultValue object The default value.
Результат BsonMemberMap

SetElementName() публичный метод

Sets the name of the element.
public SetElementName ( string elementName ) : BsonMemberMap
elementName string The name of the element.
Результат BsonMemberMap

SetIdGenerator() публичный метод

Sets the Id generator.
public SetIdGenerator ( IIdGenerator idGenerator ) : BsonMemberMap
idGenerator IIdGenerator The Id generator.
Результат BsonMemberMap

SetIgnoreIfDefault() публичный метод

Sets whether default values should be ignored when serialized.
public SetIgnoreIfDefault ( bool ignoreIfDefault ) : BsonMemberMap
ignoreIfDefault bool Whether default values should be ignored when serialized.
Результат BsonMemberMap

SetIgnoreIfNull() публичный метод

Sets whether null values should be ignored when serialized.
public SetIgnoreIfNull ( bool ignoreIfNull ) : BsonMemberMap
ignoreIfNull bool Wether null values should be ignored when serialized.
Результат BsonMemberMap

SetIsRequired() публичный метод

Sets whether an element is required for this member when deserialized
public SetIsRequired ( bool isRequired ) : BsonMemberMap
isRequired bool Whether an element is required for this member when deserialized
Результат BsonMemberMap

SetOrder() публичный метод

Sets the serialization order.
public SetOrder ( int order ) : BsonMemberMap
order int The serialization order.
Результат BsonMemberMap

SetRepresentation() публичный метод

Sets the external representation.
public SetRepresentation ( BsonType representation ) : BsonMemberMap
representation BsonType The external representation.
Результат BsonMemberMap

SetSerializationOptions() публичный метод

Sets the serialization options.
public SetSerializationOptions ( IBsonSerializationOptions serializationOptions ) : BsonMemberMap
serializationOptions IBsonSerializationOptions The serialization options.
Результат BsonMemberMap

SetSerializer() публичный метод

Sets the serializer.
public SetSerializer ( IBsonSerializer serializer ) : BsonMemberMap
serializer IBsonSerializer The serializer.
Результат BsonMemberMap

SetShouldSerializeMethod() публичный метод

Sets the method that will be called to determine whether the member should be serialized.
public SetShouldSerializeMethod ( bool>.Func shouldSerializeMethod ) : BsonMemberMap
shouldSerializeMethod bool>.Func The method.
Результат BsonMemberMap

ShouldSerialize() публичный метод

Determines whether a value should be serialized
public ShouldSerialize ( object obj, object value ) : bool
obj object The object.
value object The value.
Результат bool