From 3aab6b2344c33037def4f3f83d5c754e2ea508f5 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 10 Aug 2018 23:50:38 +0800 Subject: [PATCH] refactor --- src/DotNetCore.CAP.MongoDB/CAP.MongoDBCapOptionsExtension.cs | 5 +++-- src/DotNetCore.CAP.MongoDB/CAP.MongoDBOptions.cs | 1 + src/DotNetCore.CAP.MongoDB/MongoDBUtil.cs | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) 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 {