From 57a004aeb3d76fff31a394c54b52c675f599e614 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 17 Aug 2018 18:19:49 +0800 Subject: [PATCH] add UserMongoDB extension method --- src/DotNetCore.CAP.MongoDB/CAP.Options.Extensions.cs | 5 +++++ 1 file changed, 5 insertions(+) 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)