Commit 3aab6b23 authored by Savorboard's avatar Savorboard

refactor

parent c5b0b678
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
// Licensed under the MIT License. See License.txt in the project root for license information. // Licensed under the MIT License. See License.txt in the project root for license information.
using System; using System;
using DotNetCore.CAP;
using DotNetCore.CAP.Abstractions; using DotNetCore.CAP.Abstractions;
using DotNetCore.CAP.Processor; using DotNetCore.CAP.Processor;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace DotNetCore.CAP.MongoDB namespace DotNetCore.CAP.MongoDB
{ {
// ReSharper disable once InconsistentNaming
public class MongoDBCapOptionsExtension : ICapOptionsExtension public class MongoDBCapOptionsExtension : ICapOptionsExtension
{ {
private readonly Action<MongoDBOptions> _configure; private readonly Action<MongoDBOptions> _configure;
...@@ -23,10 +23,11 @@ namespace DotNetCore.CAP.MongoDB ...@@ -23,10 +23,11 @@ namespace DotNetCore.CAP.MongoDB
services.AddSingleton<CapDatabaseStorageMarkerService>(); services.AddSingleton<CapDatabaseStorageMarkerService>();
services.AddSingleton<IStorage, MongoDBStorage>(); services.AddSingleton<IStorage, MongoDBStorage>();
services.AddSingleton<IStorageConnection, MongoDBStorageConnection>(); services.AddSingleton<IStorageConnection, MongoDBStorageConnection>();
services.AddScoped<ICapPublisher, CapPublisher>(); services.AddScoped<ICapPublisher, CapPublisher>();
services.AddScoped<ICallbackPublisher, CapPublisher>(); services.AddScoped<ICallbackPublisher, CapPublisher>();
services.AddTransient<ICollectProcessor, MongoDBCollectProcessor>();
services.AddTransient<ICollectProcessor, MongoDBCollectProcessor>();
services.AddTransient<IMongoTransaction, MongoTransaction>(); services.AddTransient<IMongoTransaction, MongoTransaction>();
var options = new MongoDBOptions(); var options = new MongoDBOptions();
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace DotNetCore.CAP.MongoDB namespace DotNetCore.CAP.MongoDB
{ {
// ReSharper disable once InconsistentNaming
public class MongoDBOptions public class MongoDBOptions
{ {
/// <summary> /// <summary>
......
...@@ -28,6 +28,7 @@ namespace DotNetCore.CAP.MongoDB ...@@ -28,6 +28,7 @@ namespace DotNetCore.CAP.MongoDB
if (session == null) if (session == null)
{ {
result = await collection.FindOneAndUpdateAsync(filter, updateDef, _options); result = await collection.FindOneAndUpdateAsync(filter, updateDef, _options);
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment