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

Implicit conversion of IEnumerable to BsonArray requested

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.0
    • Affects Version/s: 1.0
    • Component/s: Feature Request
    • None

      It would be nice if an implicit conversion from IEnumerable to BsonArray existed so we could write code like this:

      var values = new int[]

      { 1, 2, 3 }

      ;
      var document = new BsonDocument("array", values);

      instead of:

      var document = new BsonDocument("array", new BsonArray(values));

      NOTE: make sure this implicit conversion doesn't have any undesirable side effects before implementing this request

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: