SqlSugar/Src/Asp.NetCore2/MongoDb.Ado.data/ExecuteNonQueryItemsAsync/NonFindHandlerAsync.cs

27 lines
672 B
C#
Raw Normal View History

2025-05-02 16:30:22 +08:00
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace MongoDb.Ado.data
{
public class NonFindHandlerAsync : IMongoOperationHandlerAsync
{
2025-05-02 16:55:48 +08:00
public string operation { get; set; }
2025-05-02 16:30:22 +08:00
public async Task<int> HandleAsync(IMongoCollection<BsonDocument> collection, string json)
{
2025-05-02 16:55:48 +08:00
using (var dr = await new DbDataReaderFactoryAsync().HandleAsync(operation, collection, json))
2025-05-02 16:30:22 +08:00
{
if (dr.Read())
{
}
}
return 0; // 查询不改变数据库
}
}
}