开始用的

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.

 作者:꧁执笔小白꧂