diff --git a/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItems/ExecuteHandlerFactory.cs b/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItems/ExecuteHandlerFactory.cs index ade8ffb40..9a07cd3c8 100644 --- a/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItems/ExecuteHandlerFactory.cs +++ b/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItems/ExecuteHandlerFactory.cs @@ -9,7 +9,7 @@ namespace MongoDb.Ado.data { public class ExecuteHandlerFactory { - public readonly static Dictionary Items = new Dictionary(StringComparer.OrdinalIgnoreCase) + public readonly Dictionary Items = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "insert", new InsertHandler() }, { "insertmany", new InsertManyHandler() }, @@ -25,7 +25,7 @@ namespace MongoDb.Ado.data public static int Handler(string operation, string json, IMongoCollection collection, HandlerContext handlerContext) { MongoDbMethodUtils.ValidateOperation(operation); - var handlers = ExecuteHandlerFactory.Items; + var handlers =new ExecuteHandlerFactory().Items; if (!handlers.TryGetValue(operation, out var handler)) throw new NotSupportedException($"不支持的操作类型: {operation}"); diff --git a/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItemsAsync/ExecuteHandlerFactoryAsync.cs b/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItemsAsync/ExecuteHandlerFactoryAsync.cs index ed4aa6b33..b70536cd0 100644 --- a/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItemsAsync/ExecuteHandlerFactoryAsync.cs +++ b/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItemsAsync/ExecuteHandlerFactoryAsync.cs @@ -12,7 +12,7 @@ namespace MongoDb.Ado.data { public class ExecuteHandlerFactoryAsync { - public readonly static Dictionary Items = new Dictionary(StringComparer.OrdinalIgnoreCase) + public readonly Dictionary Items = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "insert", new InsertHandlerAsync() }, { "insertmany", new InsertManyHandlerAsync() }, @@ -28,7 +28,7 @@ namespace MongoDb.Ado.data public static Task HandlerAsync(string operation, string json, IMongoCollection collection,CancellationToken cancellationToken, HandlerContext handlerContext) { MongoDbMethodUtils.ValidateOperation(operation); - var handlers = ExecuteHandlerFactoryAsync.Items; + var handlers = new ExecuteHandlerFactoryAsync().Items; if (!handlers.TryGetValue(operation, out var handler)) throw new NotSupportedException($"不支持的操作类型: {operation}");