[CSHARP-1723] BsonConstructorAttribute doesn't seem to behave as expected with named parameters Created: 25/Jul/16 Updated: 19/Oct/16 Resolved: 19/Oct/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | BSON, Serialization |
| Affects Version/s: | 2.2.4 |
| Fix Version/s: | 2.4 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Tristan Kilani-Freeman [X] | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Documentation suggests here would suggest that it's possible to map a constructor's parameters to various members by specifying them in overloads of the BsonConstructorAttribute. As far as I can tell, this attribute has only one overload, which takes a sequence of strings. Assuming that these strings are supposed to be the names of the members to map to, this does not appear to be working as intended. The following class will not serialise:
The following which follows the default naming convention does work however:
|
| Comments |
| Comment by Githook User [ 19/Oct/16 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |
| Comment by Githook User [ 19/Oct/16 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |