diff --git a/src/DotNetCore.CAP.MongoDB/CAP.MongoDBCapOptionsExtension.cs b/src/DotNetCore.CAP.MongoDB/CAP.MongoDBCapOptionsExtension.cs index 9b00686..ab1158d 100644 --- a/src/DotNetCore.CAP.MongoDB/CAP.MongoDBCapOptionsExtension.cs +++ b/src/DotNetCore.CAP.MongoDB/CAP.MongoDBCapOptionsExtension.cs @@ -2,13 +2,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. using System; -using DotNetCore.CAP; using DotNetCore.CAP.Abstractions; using DotNetCore.CAP.Processor; using Microsoft.Extensions.DependencyInjection; namespace DotNetCore.CAP.MongoDB { + // ReSharper disable once InconsistentNaming public class MongoDBCapOptionsExtension : ICapOptionsExtension { private readonly Action _configure; @@ -23,10 +23,11 @@ namespace DotNetCore.CAP.MongoDB services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddScoped(); services.AddScoped(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); var options = new MongoDBOptions(); diff --git a/src/DotNetCore.CAP.MongoDB/CAP.MongoDBOptions.cs b/src/DotNetCore.CAP.MongoDB/CAP.MongoDBOptions.cs index 98ef69b..fe00791 100644 --- a/src/DotNetCore.CAP.MongoDB/CAP.MongoDBOptions.cs +++ b/src/DotNetCore.CAP.MongoDB/CAP.MongoDBOptions.cs @@ -3,6 +3,7 @@ namespace DotNetCore.CAP.MongoDB { + // ReSharper disable once InconsistentNaming public class MongoDBOptions { /// diff --git a/src/DotNetCore.CAP.MongoDB/MongoDBUtil.cs b/src/DotNetCore.CAP.MongoDB/MongoDBUtil.cs index 3d3c1f7..4af9989 100644 --- a/src/DotNetCore.CAP.MongoDB/MongoDBUtil.cs +++ b/src/DotNetCore.CAP.MongoDB/MongoDBUtil.cs @@ -28,6 +28,7 @@ namespace DotNetCore.CAP.MongoDB if (session == null) { result = await collection.FindOneAndUpdateAsync(filter, updateDef, _options); + } else {