[CSHARP-2127] Enums with e.g. uint underlyings fail to serialized Created: 13/Dec/17 Updated: 28/Oct/23 Resolved: 06/Jan/21 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 2.4.4 |
| Fix Version/s: | 2.12.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Daniel Hegener | Assignee: | Boris Dogadov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
As per this SO issue: Easy to reproduce in EnumSerializerUInt32Tests.cs by switching from
to
and running the contained tests. Result: Exception: "Value was either too large or too small for an Int32." The problem here is in the EnumSerializer which attempts a Convert.ToInt32 for a Uint32 and a Convert.ToInt64 for a Uint64. |
| Comments |
| Comment by Boris Dogadov [ 06/Jan/21 ] |
|
Hi dnickless We have fixed this taking a slightly different approach here. |
| Comment by Boris Dogadov [ 07/Dec/20 ] |
|
rstam do we want to add support for ulong in the similar way? |
| Comment by Ian Whalen (Inactive) [ 11/Mar/19 ] |
|
Doing some backlog grooming and evaluating these PRs on a one-by-one basis. Confirming here that we want to consider this for merge as soon as 4.2 work slows down. |
| Comment by Daniel Hegener [ 14/Dec/17 ] |
|
Pretty old but related: https://jira.mongodb.org/browse/CSHARP-252 (covers the non Enum case) |
| Comment by Daniel Hegener [ 14/Dec/17 ] |