[CSHARP-131] Need an implicit conversion from Enums to Bson values Created: 13/Dec/10 Updated: 02/Apr/15 Resolved: 13/Dec/10 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 0.9 |
| Fix Version/s: | 1.0 |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Ian Mercer | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Win 7 |
||
| Description |
|
Implicit conversions are provided for most types but not for Enums. This makes querying for an Enum harder than it needs to be. Suggest adding this into the BsonValue class: public static implicit operator BsonValue(Enum value) { return BsonTypeMapper.MapToBsonValue(value); } |
| Comments |
| Comment by Robert Stam [ 13/Dec/10 ] |
|
Done. Thanks, this was a good suggestion. |