Browse Source

add UserMongoDB extension method

master
Savorboard 6 years ago
parent
commit
57a004aeb3
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/DotNetCore.CAP.MongoDB/CAP.Options.Extensions.cs

+ 5
- 0
src/DotNetCore.CAP.MongoDB/CAP.Options.Extensions.cs View File

@@ -15,6 +15,11 @@ namespace Microsoft.Extensions.DependencyInjection
return options.UseMongoDB(x => { }); return options.UseMongoDB(x => { });
} }


public static CapOptions UseMongoDB(this CapOptions options, string connectionString)
{
return options.UseMongoDB(x => { x.DatabaseConnection = connectionString; });
}

public static CapOptions UseMongoDB(this CapOptions options, Action<MongoDBOptions> configure) public static CapOptions UseMongoDB(this CapOptions options, Action<MongoDBOptions> configure)
{ {
if (configure == null) if (configure == null)


Loading…
Cancel
Save