谁能建议如何使用 Dapper ORM 检查结果集中是否有任何记录。
Customer objCustomer = null;
using (SqlMapper.GridReader multiResult = new DapperRepository().QueryMultiple(sql, new { id = id }))
{
objCustomer = multiResult.Read<Customer>().Single(); //null exception
}
谁能建议如何使用 Dapper ORM 检查结果集中是否有任何记录。
Customer objCustomer = null;
using (SqlMapper.GridReader multiResult = new DapperRepository().QueryMultiple(sql, new { id = id }))
{
objCustomer = multiResult.Read<Customer>().Single(); //null exception
}