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

Static BsonTypeMapper function to cast from BsonValue to native types

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.11
    • Affects Version/s: 0.9
    • Component/s: Feature Request
    • None
    • Environment:
      All
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: