Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2150

RegisterSerializer should check that the serializer's ValueType matches the type it is being registered for

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5
    • Component/s: Serialization
    • Labels:
      None

      The following should result in an exception thrown when RegisterSerializer is called:

      var intSerializer = new Int32Serializer();
      BsonSerializer.RegisterSerializer(typeof(long), intSerializer);
      

      because the types don't agree.

            Assignee:
            Unassigned Unassigned
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: