mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
25 lines
617 B
C#
25 lines
617 B
C#
using MongoDB.Bson;
|
|
using MongoDB.Driver;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace MongoDb.Ado.data
|
|
{
|
|
public class ExecuteScalarHandler
|
|
{
|
|
public object Handle(string operation, IMongoCollection<BsonDocument> collection, string json)
|
|
{
|
|
using (var dbReader = new DbDataReaderFactory().Handle(operation, collection, json))
|
|
{
|
|
if (dbReader.Read())
|
|
{
|
|
return dbReader.GetValue(0);
|
|
}
|
|
return null; //
|
|
}
|
|
}
|
|
}
|
|
}
|