FromConnectionStringBuilder() 공개 정적인 메소드

Gets a MongoClientSettings object intialized with values from a connection string builder.
public static FromConnectionStringBuilder ( MongoConnectionStringBuilder builder ) : MongoClientSettings
builder MongoConnectionStringBuilder The connection string builder.
리턴 MongoClientSettings
예제 #1
0
 // private static methods
 private static MongoClientSettings ParseConnectionString(string connectionString)
 {
     if (connectionString.StartsWith("mongodb://"))
     {
         var url = new MongoUrl(connectionString);
         return(MongoClientSettings.FromUrl(url));
     }
     else
     {
         var builder = new MongoConnectionStringBuilder(connectionString);
         return(MongoClientSettings.FromConnectionStringBuilder(builder));
     }
 }