Class ComplexObjectValueTypeSerializer
Represents a serializer for complex object value types, deriving from MongoDB.Bson.Serialization.Serializers.SerializerBase<TValue> with object as the type argument.
public class ComplexObjectValueTypeSerializer : SerializerBase<object>, IBsonSerializer<object>, IBsonSerializer
- Inheritance
-
SerializerBase<object>ComplexObjectValueTypeSerializer
- Implements
-
IBsonSerializer<object>IBsonSerializer
- Inherited Members
-
SerializerBase<object>.GetHashCode()SerializerBase<object>.CreateCannotBeDeserializedException()SerializerBase<object>.CreateCannotBeSerializedException()SerializerBase<object>.CreateCannotDeserializeFromBsonTypeException(BsonType)SerializerBase<object>.EnsureBsonTypeEquals(IBsonReader, BsonType)SerializerBase<object>.ValueType
- Extension Methods
Remarks
Declared as a partial class, allowing its definition to be split across multiple files.
Methods
Deserialize(BsonDeserializationContext, BsonDeserializationArgs)
Deserializes a value.
public override object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
Parameters
contextBsonDeserializationContextThe deserialization context.
argsBsonDeserializationArgsThe deserialization args.
Returns
- object
A deserialized value.
Serialize(BsonSerializationContext, BsonSerializationArgs, object)
Serializes a value of an unknown runtime type into BSON, handling common primitives, OptionList, PatientAllergiesValue, and their list variants directly, and using reflection to dispatch generic MongoDB.Bson.Serialization.Serializers.ArraySerializer<TItem> for arbitrary ICollection instances. For any other type, the value is converted to JSON, parsed into a MongoDB.Bson.BsonDocument, tagged with its full type name in the _t field, and then written out.
public override void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
Parameters
contextBsonSerializationContextThe BSON serialization context that provides the writer used to emit the serialized output.
argsBsonSerializationArgsAdditional BSON serialization arguments passed through to the underlying serializers.
valueobjectThe runtime value to serialize. A
nullvalue is written as a BSON null; all other values are dispatched based on their concrete type.