开始用的 登录后复制 int count = conn.Query<int>(sqlStr, param).FirstOrDefault(); // return count > 0 ? true : false; 1. 报错,所以我用的是 登录后复制 using System.Linq; using Dapper; int count = connection.Query(sqlStr.ToString(), new { Phone = phone }).Count(); // 引用Linq 1.2.3.4. 作者:꧁执笔小白꧂ 原创作者: u_16822845 转载于: https://blog.51cto.com/u_16822845/11676090