Make C# driver deserialize Doubles and LongNumber(Int64) in MongoDocuments to Int32s
(CSHARP-112)
|
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 0.11 |
| Type: | Sub-task | Priority: | Minor - P4 |
| Reporter: | Justin Dearing | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The proposed attribute could be applied to numeric properties of classes that are deserialized from Bson Documents It shall allow you to become more strict or less strict about: I'll propose the name BsonNumericConversionAttribute, but I am open to a shorter name if it does not reduce the clarity of what it does. |
| Comments |
| Comment by Robert Stam [ 21/Jan/11 ] |
|
Implemented the spirit of this request but differently. There is no need to have any options for conversions that don't lose data, and the only data losses that can occur are overflow and truncation (i.e. loss of precision). To control whether these types of losses are allowed or not I added the AllowOverflow and AllowTruncation properties to the RepresentationSerializationOptions and BsonRepresentationAttribute classes, so no new attribute was required. |