public Task <PagesList <T> > QueryPageListAsync <T>(string sql, object param, PagesList <T> ts) where T : class { throw new NotImplementedException(); }
public async Task <PagesList <T> > QueryPageListAsync <T>(string sql, object param, PagesList <T> ts) where T : class { using (var conn = DbConnectionFactory.CetDbConnection(DbConnectionType.Read)) { using (var multi = await conn.QueryMultipleAsync(sql, param)) { if (multi.IsConsumed) //True表示已经释放 { ts.totalCount = 0; return(null); } ts.totalCount = multi.Read <int>().SingleOrDefault(); ts.pageList = multi.Read <T>().ToList(); return(ts); } } }