Class DictionaryInterfaceImplementerSerializer<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 DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> : DictionarySerializerBase<TDictionary, TKey, TValue>, IBsonSerializer<TDictionary>, IBsonArraySerializer, IBsonDocumentSerializer, IBsonSerializer, IBsonDictionarySerializer, IChildSerializerConfigurable, IDictionaryRepresentationConfigurable<DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>>, IDictionaryRepresentationConfigurable where TDictionary : class, IDictionary<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>DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
- Implements
-
IBsonSerializer<TDictionary>IDictionaryRepresentationConfigurable<DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>>
- Inherited Members
- Extension Methods
Constructors
DictionaryInterfaceImplementerSerializer()
Initializes a new instance of the DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> class.
public DictionaryInterfaceImplementerSerializer()
DictionaryInterfaceImplementerSerializer(DictionaryRepresentation)
Initializes a new instance of the DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> class.
public DictionaryInterfaceImplementerSerializer(DictionaryRepresentation dictionaryRepresentation)
Parameters
dictionaryRepresentation
DictionaryRepresentationThe dictionary representation.
DictionaryInterfaceImplementerSerializer(DictionaryRepresentation, IBsonSerializer<TKey>, IBsonSerializer<TValue>)
Initializes a new instance of the DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> class.
public DictionaryInterfaceImplementerSerializer(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.
WithDictionaryRepresentation(DictionaryRepresentation)
Returns a serializer that has been reconfigured with the specified dictionary representation.
public DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> WithDictionaryRepresentation(DictionaryRepresentation dictionaryRepresentation)
Parameters
dictionaryRepresentation
DictionaryRepresentationThe dictionary representation.
Returns
- DictionaryInterfaceImplementerSerializer<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 DictionaryInterfaceImplementerSerializer<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
- DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
The reconfigured serializer.
WithKeySerializer(IBsonSerializer<TKey>)
Returns a serializer that has been reconfigured with the specified key serializer.
public DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> WithKeySerializer(IBsonSerializer<TKey> keySerializer)
Parameters
keySerializer
IBsonSerializer<TKey>The key serializer.
Returns
- DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
The reconfigured serializer.
WithValueSerializer(IBsonSerializer<TValue>)
Returns a serializer that has been reconfigured with the specified value serializer.
public DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue> WithValueSerializer(IBsonSerializer<TValue> valueSerializer)
Parameters
valueSerializer
IBsonSerializer<TValue>The value serializer.
Returns
- DictionaryInterfaceImplementerSerializer<TDictionary, TKey, TValue>
The reconfigured serializer.