[CSHARP-3985] Support multiple SerializerRegistry(s) Created: 05/Dec/21 Updated: 09/Jan/24 |
|
| Status: | Backlog |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 2.14.0 |
| Fix Version/s: | 3.0.0 |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Mirko Da Corte | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | Implement 3.0 release | ||||||||
| Quarter: | FY24Q3 | ||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
|
The class MongoCollectionSettings exposes the property SerializerRegistry with only a getter, and it always return the static instance of BsonSerializer.SerializerRegistry. I propose to add a setter, keeping static instance as default, but permitting to change it if needed. |
| Comments |
| Comment by Shay Nissel [ 26/May/23 ] |
|
That feature would be extremely helpful. Trying to integrate apps to use multiple databases/collections that are using different serializations and conventions. For now, our only solution is convert all databases/collections to adhere to the same settings. |
| Comment by Mirko Da Corte [ 06/Dec/21 ] |
|
Yes, I saw your previous ticket. This proposed by me was a simpler middle-step for reach final target of having a multi-context env. I had to fork the library because this is a blocking missing feature for another my project. Anyway, I really hope that multi-context will be released with 3.0 drivers! |
| Comment by Robert Stam [ 06/Dec/21 ] |
|
See the discussion for a very similar ticket created for the 1.x driver a long time ago: https://jira.mongodb.org/browse/CSHARP-655. |
| Comment by Robert Stam [ 06/Dec/21 ] |
|
Hi Mirko, Thank you for submitting this proposal. The idea of supporting multiple serializer registries has been around for awhile, but it almost certainly involves much more work than just making this settings property settable. We certainly expect to eventually support multiple serializer registries, but not in the short term. Perhaps in the next major version of the driver.
|