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.
- is depended on by
-
CSHARP-4248 Allow collectionless $lookup with $documents
- In Code Review