mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-25 01:14:33 +08:00
Update mongodb
This commit is contained in:
parent
e47c66aa58
commit
e999988ec3
@ -7,7 +7,7 @@ namespace MongoDb.Ado.data
|
|||||||
{
|
{
|
||||||
public class MongoDbMethodUtils
|
public class MongoDbMethodUtils
|
||||||
{
|
{
|
||||||
public void ValidateOperation(string operation)
|
public static void ValidateOperation(string operation)
|
||||||
{
|
{
|
||||||
if (ExecuteHandlerFactory.Items.TryGetValue(operation, out var handler))
|
if (ExecuteHandlerFactory.Items.TryGetValue(operation, out var handler))
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,7 @@ namespace MongoDb.Ado.data
|
|||||||
};
|
};
|
||||||
public DbDataReader Handle(string operation, IMongoCollection<BsonDocument> collection, string json)
|
public DbDataReader Handle(string operation, IMongoCollection<BsonDocument> collection, string json)
|
||||||
{
|
{
|
||||||
|
MongoDbMethodUtils.ValidateOperation(operation);
|
||||||
var doc = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonValue>(json);
|
var doc = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonValue>(json);
|
||||||
DbDataReaderFactory.Items.TryGetValue(operation, out var handler);
|
DbDataReaderFactory.Items.TryGetValue(operation, out var handler);
|
||||||
if (handler==null)
|
if (handler==null)
|
||||||
|
@ -20,6 +20,7 @@ namespace MongoDb.Ado.data
|
|||||||
};
|
};
|
||||||
public async Task<DbDataReader> HandleAsync(string operation, IMongoCollection<BsonDocument> collection, string json)
|
public async Task<DbDataReader> HandleAsync(string operation, IMongoCollection<BsonDocument> collection, string json)
|
||||||
{
|
{
|
||||||
|
MongoDbMethodUtils.ValidateOperation(operation);
|
||||||
var doc = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonValue>(json);
|
var doc = MongoDB.Bson.Serialization.BsonSerializer.Deserialize<BsonValue>(json);
|
||||||
DbDataReaderFactoryAsync.Items.TryGetValue(operation, out var handler);
|
DbDataReaderFactoryAsync.Items.TryGetValue(operation, out var handler);
|
||||||
if (handler == null)
|
if (handler == null)
|
@ -23,6 +23,7 @@ namespace MongoDb.Ado.data
|
|||||||
|
|
||||||
public static int Handler(string operation, string json, IMongoCollection<BsonDocument> collection)
|
public static int Handler(string operation, string json, IMongoCollection<BsonDocument> collection)
|
||||||
{
|
{
|
||||||
|
MongoDbMethodUtils.ValidateOperation(operation);
|
||||||
var handlers = ExecuteHandlerFactory.Items;
|
var handlers = ExecuteHandlerFactory.Items;
|
||||||
|
|
||||||
if (!handlers.TryGetValue(operation, out var handler))
|
if (!handlers.TryGetValue(operation, out var handler))
|
||||||
|
@ -24,6 +24,7 @@ namespace MongoDb.Ado.data
|
|||||||
|
|
||||||
public static Task<int> HandlerAsync(string operation, string json, IMongoCollection<BsonDocument> collection)
|
public static Task<int> HandlerAsync(string operation, string json, IMongoCollection<BsonDocument> collection)
|
||||||
{
|
{
|
||||||
|
MongoDbMethodUtils.ValidateOperation(operation);
|
||||||
var handlers = ExecuteHandlerFactoryAsync.Items;
|
var handlers = ExecuteHandlerFactoryAsync.Items;
|
||||||
|
|
||||||
if (!handlers.TryGetValue(operation, out var handler))
|
if (!handlers.TryGetValue(operation, out var handler))
|
Loading…
Reference in New Issue
Block a user