Dapper查询是否存在数据
开始用的
int count = conn.Query<int>(sqlStr, param).FirstOrDefault(); // return count > 0 ? true : false;
报错,所以我用的是
using System.Linq;
using Dapper;
int count = connection.Query(sqlStr.ToString(), new { Phone = phone }).Count(); // 引用Linq
本文来自博客园,作者:꧁执笔小白꧂,转载请注明原文链接:https://www.cnblogs.com/qq2806933146xiaobai/p/14894022.html