[CSHARP-43] Saving empty SortedList<object,int> crashes when getting object Created: 18/Jun/10 Updated: 19/Oct/16 Resolved: 18/Jun/10 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | nisbus | Assignee: | Steve Wagner |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
VS2010, .NET 4 |
||
| Attachments: |
|
| Description |
|
If you save an object that has a SortedList property and then try to get it from the database you get a cast exception: Unable to cast object of type 'System.Object[]' to type 'System.Collections.Generic.SortedList`2[MyObject,System.Int32]'. |
| Comments |
| Comment by Craig Wilson [ 20/Jun/10 ] |
|
I believe integers would work as well. |
| Comment by nisbus [ 18/Jun/10 ] |
|
This only works if the Key of the SortedList is of type string. |
| Comment by Steve Wagner [ 18/Jun/10 ] |
|
Fixed in my local branch http://github.com/lanwin/mongodb-csharp/tree/090beta2 |