[CSHARP-723] Enum can't be deserialized when using Linq Created: 11/Apr/13 Updated: 19/Oct/16 Resolved: 16/Apr/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.8.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | kelly elton | Assignee: | Sridhar Nanjundeswaran |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | C#, Enum, Linq | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
.net 4.5 Windows Ubuntu 12.04 |
||
| Description |
|
So I have this enum
In this interface
I plop one of these guys in the database, and it goes fine. Then when I try and grab one with this code
That throws an exception
My first go I didn't have the enums assigned to integers, and that produced the same result. I'm seeing this on two different machines, and two fresh installs of MongoDb, one on windows and one on Ubuntu 12.04. |
| Comments |
| Comment by kelly elton [ 16/Apr/13 ] |
|
Minus the enums it seems to work fine. It seems like if I return an Thanks, On Tue, Apr 16, 2013 at 3:38 PM, Sridhar Nanjundeswaran (JIRA) < |
| Comment by Sridhar Nanjundeswaran [ 16/Apr/13 ] |
|
The reason it fails is that we do not support deserializing interfaces. This is because the different implementations could have different serialization settings and the driver would not know which of the classmaps it needs to use in the deserialization process. |