[CSHARP-583] Allow Injection of custom primitive serializers into existing Seralization Stack Created: 28/Sep/12 Updated: 05/Apr/19 Resolved: 28/Sep/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Daniel Sinclair | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | c#, driver, question, serialization, serializers | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Issue Links: |
|
||||||||
| Description |
|
I would like to be able to allow for custom serialization without having to replace the entire serialization stack. This would be relatively easy to do except that the relevant classes are sealed and there's no hook to modify the static list of serializers used by default. For instance, if I want to replace the DateTime serializer, or the Int64 serlializer I want to be able to add that into the existing stack. I do not want to have to completely replace the entire stack. See here; |
| Comments |
| Comment by Craig Wilson [ 11/Oct/12 ] |
|
This works as designed. |
| Comment by Robert Stam [ 28/Sep/12 ] |
|
You can easily register your own serializers, you just have to register your serializers early enough (before the driver registers one). I wrote a detailed answer to the stackoverflow question so please read that for further details. |