Currently when our LINQ provider translates an Expression it does not know where that result will be used, so sometimes the result is serialized differently than what the target use expects.
This could be supported by having the caller of `Translate` pass in a `targetSerializer` that describes how the caller needs the result to be serialized. The caller could pass `null` for `targetSerializer` if it doesn't care.
CSHARP-5435 is one example of this, where `Update.Set` needs the results returned by the translated Expression to match the way the field being set is serialized. But this is just one case, there will be others.
- is depended on by
-
CSHARP-5435 NotSupportedException when using Set with sub-documents in an Update with Aggregation Pipeline
- Blocked
- related to
-
CSHARP-4819 ReplaceWith not respecting custom element name configured by the serializer
- Blocked