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

Remove KnownSerializerRegistry

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 3.2.0
    • Affects Version/s: 3.0.0
    • Component/s: Linq
    • None
    • Fully Compatible
    • Dotnet Drivers
    • Not Needed

      The LINQ provider uses a KnownSerializerRegistry to help figure out what serializer to use at each level of the Expression tree being translated.

      The idea is that we can pre-walk the Expression tree before translation and figure out what serializers are known at each node of the expression tree. Then during translation we can simply look up any serializer we need by passing an Expression node to the known serializer registry lookup method.

      This seems theoretically sound, but as it turned out it is often easier to figure out what serializer to use during the translation itself rather than to try and figure that out in advance. More and more translation methods have stopped relying on the KnownSerializerRegistry, to the point where we might as well eliminate the KnownSerializerRegistry.

      There are only about a dozen remaining users of the KnownSerializerRegistry, and an initial evaluation indicates that at least half of them can be trivially refactored and the rest shouldn't be hard to refactor also.

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

              Created:
              Updated:
              Resolved: