public Tuple <IEnumerable <A>, IEnumerable <B> > Muilt <A, B>(string muilSql, object paramObj = null) { using (var muilt = CurConn.QueryMultiple(muilSql, paramObj)) { var one = muilt.Read <A>(); var two = muilt.Read <B>(); return(Tuple.Create <IEnumerable <A>, IEnumerable <B> >(one, two)); } }
public Tuple <IEnumerable <T>, int> Page <T>(string countSql, string dataSql, object paramObj = null) { using (var muilt = CurConn.QueryMultiple(string.Format("{0};{1}", countSql, dataSql), paramObj)) { int count = muilt.Read <int>().FirstOrDefault(); if (count <= 0) { return(new Tuple <IEnumerable <T>, int>(new List <T>(), 0)); } var data = muilt.Read <T>(); return(new Tuple <IEnumerable <T>, int>(data, count)); } }