mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-20 15:09:33 +08:00
26 lines
685 B
C#
26 lines
685 B
C#
using MongoDB.Bson;
|
|
using MongoDB.Driver;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MongoDb.Ado.data
|
|
{
|
|
public class ExecuteScalarHandlerAsync
|
|
{
|
|
public async Task<object> HandleAsync(string operation, IMongoCollection<BsonDocument> collection, string json)
|
|
{
|
|
using (var dbReader = await new DbDataReaderFactoryAsync().HandleAsync(operation, collection, json))
|
|
{
|
|
if (dbReader.Read())
|
|
{
|
|
return dbReader.GetValue(0);
|
|
}
|
|
return null; //
|
|
}
|
|
}
|
|
}
|
|
}
|