1 Commits (d2b72a19c93d73f3ac52a5b2f75eb3722d561fdd)

Author SHA1 Message Date
rstam d2b72a19c9 Implemented DictionaryGenericSerializer. 15 years ago
rstam 8e7a944581 This commit is about simplifying serialization and improving performance at the same time. At the lowest level, the API for BsonReader and BsonWriter has changed to support the higher level changes. The DeserializeDocument/DeserializeElement and SerializeDocument/SerializeElement paired methods have been simplified to just Deserialize and Serialize. Similarly, the GetActualDocumentType/GetActualElementType paired methods in IDiscriminatorConvention have been simplified to a single GetActualType method. The HasElement methods in BsonReader have been removed because using them resulted in BsonTypes and Names being read twice. The support for bookmarks in BsonReader has been decoupled from the context stack. BsonWriter now allows the Name to be written before the BsonType is known (in the BSON binary form the BsonType comes before the Name) and delays physically writing the name to the BSON output stream until the value is written at which point the BsonType is known. 15 years ago
rstam c45d4d052d Relax the restriction that a class must have a public default constructor in order to be deserialized (now a default constructor, public or private, will be used if it exists, otherwise FormatterServices.GetUninitializedObject will be used to create a zero filled instance). 15 years ago
rstam 748dfb3468 Added DiscriminatorConventions to allow more flexibility in how discriminators are used. Includes partial support for hierarchical discriminators (but a little more work is required to know when hierarchical discriminators should be used and where the hierarchy should be rooted). 15 years ago
rstam 745dce7f9b Added support for serializing LinkedList<T>. 15 years ago
rstam e918733496 Consolidated collection serializers in CollectionSerializers.cs and CollectionSerializersGeneric.cs (and similarly for the unit tests). Added unit tests for more generic collection types. 15 years ago
rstam b64578f7b7 Moved handling of generic serializers up from BsonDefaultSerializer to BsonSerializer. It's a general enough mechanism that any serialization provider could choose to use it. 15 years ago
rstam 55bb3a2cdb Renamed BsonDefaultSerializationProvider to BsonDefaultSerializer (no change in design, just using a shorter name based on what it is rather than what interface it implements). 15 years ago
rstam d733e05f33 Implemented StackSerializer. 15 years ago
rstam dea18ba040 Implemented QueueSerializer. Added EnumerableSerializerRegistration and QueueSerializerRegistration and modified BsonDefaultSerializationProvider to find registration methods for generic serializer definitions. 15 years ago
rstam 660b6208d5 Fixed CSHARP-83. Implemented new EnumerableSerializer<T> generic serializer definition. Created a way to register and lookup generic serializer definitions and to instantiate closed generic serializers at runtime. 15 years ago
rstam d13dda9efb Implemented EnumerableSerializer (serializes ArrayList, IEnumerable, ICollection and IList). Factored out GetActualDocumentType and GetActualElementType as static methods that can be called as needed from anywhere. Use BsonType as implied discriminator for primitive types. Fixed references to deprecated BsonConstants. 15 years ago