Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-131

Need an implicit conversion from Enums to Bson values

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.0
    • 0.9
    • None
    • None
    • 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); }

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            ianmercer Ian Mercer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: