diff --git a/src/DotNetCore.CAP.MongoDB/CAP.Options.Extensions.cs b/src/DotNetCore.CAP.MongoDB/CAP.Options.Extensions.cs index 3a64171..eb9b8df 100644 --- a/src/DotNetCore.CAP.MongoDB/CAP.Options.Extensions.cs +++ b/src/DotNetCore.CAP.MongoDB/CAP.Options.Extensions.cs @@ -15,6 +15,11 @@ namespace Microsoft.Extensions.DependencyInjection 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 configure) { if (configure == null)