Exemplo n.º 1
0
 /// <summary>
 ///     转换为int
 /// </summary>
 /// <param name="obj">数据</param>
 public static int ToInt(this string obj)
 {
     return(Convert.ToInt(obj));
 }
Exemplo n.º 2
0
 /// <summary>
 ///     获取整型
 /// </summary>
 /// <param name="connection">数据库连接</param>
 public int ToInt(IDbConnection connection = null)
 {
     return(Convert.ToInt(ToScalar(connection, GetSql(), Params)));
 }
Exemplo n.º 3
0
 /// <summary>
 ///     获取行数
 /// </summary>
 protected virtual int GetCount(IDbConnection connection)
 {
     return(Convert.ToInt(ToScalar(connection, GetCountSql(), Params)));
 }
Exemplo n.º 4
0
 /// <summary>
 ///     获取行数
 /// </summary>
 protected virtual async Task <int> GetCountAsync(IDbConnection connection)
 {
     return(Convert.ToInt(await ToScalarAsync(connection, GetCountSql(), Params)));
 }
Exemplo n.º 5
0
 /// <summary>
 ///     获取整型
 /// </summary>
 /// <param name="connection">数据库连接</param>
 public async Task <int> ToIntAsync(IDbConnection connection = null)
 {
     return(Convert.ToInt(await ToScalarAsync(connection, GetSql(), Params)));
 }