Class ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
- Namespace
- MongoDB.Bson.Serialization.Serializers
- Assembly
- MongoDB.Bson.dll
Represents a serializer for a class that implements IDictionary<TKey, TValue>.
public class ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> : DictionarySerializerBase<TDictionary, TKey, TValue>, IBsonSerializer<TDictionary>, IBsonArraySerializer, IBsonDocumentSerializer, IBsonSerializer, IBsonDictionarySerializer, IChildSerializerConfigurable, IDictionaryRepresentationConfigurable<ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>>, IDictionaryRepresentationConfigurable where TDictionary : class, IReadOnlyDictionary<TKey, TValue>
Type Parameters
TDictionary
The type of the dictionary.
TKey
The type of the key.
TValue
The type of the value.
- Inheritance
-
SerializerBase<TDictionary>ClassSerializerBase<TDictionary>DictionarySerializerBase<TDictionary, TKey, TValue>ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
- Implements
-
IBsonSerializer<TDictionary>IDictionaryRepresentationConfigurable<ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>>
- Inherited Members
- Extension Methods
Constructors
ReadOnlyDictionaryInterfaceImplementerSerializer()
Initializes a new instance of the ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> class.
public ReadOnlyDictionaryInterfaceImplementerSerializer()
ReadOnlyDictionaryInterfaceImplementerSerializer(DictionaryRepresentation)
Initializes a new instance of the ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> class.
public ReadOnlyDictionaryInterfaceImplementerSerializer(DictionaryRepresentation dictionaryRepresentation)
Parameters
dictionaryRepresentation
DictionaryRepresentationThe dictionary representation.
ReadOnlyDictionaryInterfaceImplementerSerializer(DictionaryRepresentation, IBsonSerializer<TKey>, IBsonSerializer<TValue>)
Initializes a new instance of the ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> class.
public ReadOnlyDictionaryInterfaceImplementerSerializer(DictionaryRepresentation dictionaryRepresentation, IBsonSerializer<TKey> keySerializer, IBsonSerializer<TValue> valueSerializer)
Parameters
dictionaryRepresentation
DictionaryRepresentationThe dictionary representation.
keySerializer
IBsonSerializer<TKey>The key serializer.
valueSerializer
IBsonSerializer<TValue>The value serializer.
Methods
CreateAccumulator()
Creates an accumulator.
protected override ICollection<KeyValuePair<TKey, TValue>> CreateAccumulator()
Returns
- ICollection<KeyValuePair<TKey, TValue>>
The accumulator.
FinalizeAccumulator(ICollection<KeyValuePair<TKey, TValue>>)
Finalizes an accumulator.
protected override TDictionary FinalizeAccumulator(ICollection<KeyValuePair<TKey, TValue>> accumulator)
Parameters
accumulator
ICollection<KeyValuePair<TKey, TValue>>The accumulator to finalize
Returns
- TDictionary
The instance.
WithDictionaryRepresentation(DictionaryRepresentation)
Returns a serializer that has been reconfigured with the specified dictionary representation.
public ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> WithDictionaryRepresentation(DictionaryRepresentation dictionaryRepresentation)
Parameters
dictionaryRepresentation
DictionaryRepresentationThe dictionary representation.
Returns
- ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
The reconfigured serializer.
WithDictionaryRepresentation(DictionaryRepresentation, IBsonSerializer<TKey>, IBsonSerializer<TValue>)
Returns a serializer that has been reconfigured with the specified dictionary representation and key value serializers.
public ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> WithDictionaryRepresentation(DictionaryRepresentation dictionaryRepresentation, IBsonSerializer<TKey> keySerializer, IBsonSerializer<TValue> valueSerializer)
Parameters
dictionaryRepresentation
DictionaryRepresentationThe dictionary representation.
keySerializer
IBsonSerializer<TKey>The key serializer.
valueSerializer
IBsonSerializer<TValue>The value serializer.
Returns
- ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
The reconfigured serializer.
WithKeySerializer(IBsonSerializer<TKey>)
Returns a serializer that has been reconfigured with the specified key serializer.
public ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> WithKeySerializer(IBsonSerializer<TKey> keySerializer)
Parameters
keySerializer
IBsonSerializer<TKey>The key serializer.
Returns
- ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
The reconfigured serializer.
WithValueSerializer(IBsonSerializer<TValue>)
Returns a serializer that has been reconfigured with the specified value serializer.
public ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> WithValueSerializer(IBsonSerializer<TValue> valueSerializer)
Parameters
valueSerializer
IBsonSerializer<TValue>The value serializer.
Returns
- ReadOnlyDictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
The reconfigured serializer.