Example #1
0
 public static BuiltOptions UseMongodb(this BuiltOptions options, MongoUrl url)
 {
     if (url == null)
     {
         throw new ArgumentNullException(nameof(url));
     }
     options.Url = url;
     return(options.UseMongodb(MongoClientSettings.FromUrl(url)));
 }
Example #2
0
 public static BuiltOptions UseMongodb(this BuiltOptions options, string connectionString)
 {
     if (string.IsNullOrWhiteSpace(connectionString))
     {
         throw new ArgumentNullException(nameof(connectionString));
     }
     options.ConnectionString = connectionString;
     return(options.UseMongodb(new MongoUrl(connectionString)));
 }