Unable to explicitly set serializer for recursive enumerable types

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • 2.1
    • Affects Version/s: 2.0
    • Component/s: Serialization
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The following Main function will blow up, due to the constructor for ArraySerializer registering a class map for the type before the class map can be registered.

      void Main()
      {
      	BsonClassMap.RegisterClassMap<ModelType>(x => {
      		x.MapMember(y => y.ModelTypes).SetSerializer(new ArraySerializer<ModelType>());
      	});
      }
      
      // Define other methods and classes here
      public class ModelType
      {
      	public ModelType[] ModelTypes { get; set; }
      }
      

              Assignee:
              Unassigned
              Reporter:
              David Pfeffer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: