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

Static BsonTypeMapper function to cast from BsonValue to native types

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 0.11
    • 0.9
    • Feature Request
    • None
    • All
    • Fully Compatible

    Description

      Is it possible to incorporate a static function to map BsonValues back to .NET types? The current conversion is one way only.
      This will open up avenues for developers writing generic classes that accept types (e.g. strongly typed generic cache manager class using MongoDb as the store)

      I have attached an implementation in the BsonTypeMapper class I have been testing with my code. The implementation uses the type mapping declared in the private dictionaries.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            derfel J W Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: