[CSHARP-1839] EnumRepresentationConvention should apply to nullable enums Created: 25/Nov/16  Updated: 19/Dec/16  Resolved: 08/Dec/16

Status: Closed
Project: C# Driver
Component/s: Serialization
Affects Version/s: 2.0
Fix Version/s: 2.4.1

Type: Bug Priority: Major - P3
Reporter: Matthew Whetton Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The EnumRepresentationConvention does not currently apply to nullable enums.

i.e. nullable enums are persisted using integer values even when the EnumRepresentationConvention is applied.

EnumRepresentationConvention should apply to nullable enums.

This is a slight backward breaking change in that the serialization format of nullable enums might change when using this convention. That won't be a problem for round tripping because the Deserialize method accepts either integers or strings, but must be taken into account if writing queries against the nullable enum field.



 Comments   
Comment by Githook User [ 08/Dec/16 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1839: EnumRepresentationConvention should apply to nullable enums.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/4bf62804c4faa566a9242cf99f0240aa62f532b3

Generated at Wed Feb 07 21:40:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.