mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 23:13:42 +08:00
25 lines
649 B
C#
25 lines
649 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, HandlerContext context)
|
|
{
|
|
using (var dbReader = new DbDataReaderFactory().Handle(operation, collection, json,context))
|
|
{
|
|
if (dbReader.Read())
|
|
{
|
|
return dbReader.GetValue(0);
|
|
}
|
|
return null; //
|
|
}
|
|
}
|
|
}
|
|
}
|