using Dapper; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CNet { public interface IDapperHelper { /// /// Excute返回受影响行数 /// /// /// /// int Excute(string sql, object param = null, IDbTransaction transaction = null, int? commandTimeout = null, CommandType? commandType = null); /// ///返回table数据 /// /// DataTable ExecuteReaderToTable(string sql, object param = null, IDbTransaction transaction = null, int? commandTimeout = null, CommandType? commandType = null); /// /// 查询返回list /// /// /// /// /// List Query(string sql, object param = null, IDbTransaction transaction = null, bool buffered = true, int? commandTimeout = null, CommandType? commandType = null); /// /// 查询返回第一个元素 /// /// /// /// /// T QueryFirst(string sql, object param = null, IDbTransaction transaction = null, int? commandTimeout = null, CommandType? commandType = null); /// /// 查询返回多个列表结果 /// /// /// /// /// /// /// /// SqlMapper.GridReader QueryMultiple(string sql, object param = null, IDbTransaction transaction = null, bool buffered = true, int? commandTimeout = null, CommandType? commandType = null); /// /// 返回受影响第一列 /// /// /// /// object ExecuteScalar(string sql, object param = null, IDbTransaction transaction = null, int? commandTimeout = null, CommandType? commandType = null); /// /// 符合条件的第一行数据 /// /// /// /// /// T FirstOrDefault(string sql, object param = null) where T : class; /// /// 执行事务 /// /// /// /// bool ExecTransaction(Dictionary dic, List proName = null); } }