title: mongodb obtaining collection names c#
body: <p>I'm trying to obtain a list of all databases and the associated list of collections for a connection using Mongo C# Driver. </p>
  
  <pre><code>foreach (string database in server.GetDatabaseNames())
   {
    var db = client.GetDatabase(database);
  
    var col = ((MongoDatabase)db).GetCollectionNames();
  
     //Do something
      }
  </code></pre>
  
  <p>I'm able to obtain the list of databases but not the collection names. It doesn't get past </p>
  
  <pre><code>         ((MongoDatabase)db).GetCollectionNames();
  </code></pre>
  
  <p>What am I possibly missing?</p>