[CSHARP-1856] SetOrder doesn't seem to order the field in the document Created: 01/Dec/16 Updated: 19/Dec/16 Resolved: 02/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: | Peter Garafano (Inactive) | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I have a class, Foo, that looks like the following.
And I map the class as follows
I expect my document to look like the following
But they actually look like this.
In order to get the desired order, I have to do the following mapping, making AutoMap last.
These should either be independent of order or we need to be explicit that SetOrder needs to come first. |
| Comments |
| Comment by Githook User [ 02/Dec/16 ] | ||||||||||||||
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: | ||||||||||||||
| Comment by Peter Garafano (Inactive) [ 01/Dec/16 ] | ||||||||||||||
|
Hi Ryan, I didn't consider the GetMemberMap method. I modified the class map as you suggested, to look like this:
However it still yields the undesired ordering.
Thanks, | ||||||||||||||
| Comment by Ryan Kuhn [ 01/Dec/16 ] | ||||||||||||||
|
Have you tried: cm.AutoMap(); |