@@ -161,7 +158,7 @@ public virtual IEnumerable<dynamic> Query(string sql, DbConnection connection, p
{
while(rdr.Read())
{
yieldreturnrdr.RecordToExpando();;
yieldreturnrdr.RecordToExpando();
}
}
...
...
@@ -420,7 +417,7 @@ public virtual dynamic Paged(string where = "", string orderBy = "", string colu
where="WHERE "+where;
}
}
varsql=string.Format("SELECT {0} FROM (SELECT ROW_NUMBER() OVER (ORDER BY {2}) AS Row, {0} FROM {3} {4}) AS Paged ",columns,pageSize,orderBy,TableName,where);
varsql=string.Format("SELECT {0} FROM (SELECT ROW_NUMBER() OVER (ORDER BY {2}) AS Row, {0} FROM {3} {4}) AS Paged ",columns,orderBy,TableName,where);
varpageStart=(currentPage-1)*pageSize;
sql+=string.Format(" WHERE Row >={0} AND Row <={1}",pageStart,(pageStart+pageSize));
varresult=connection.Query<Foo1,Bar1,Tuple<Foo1,Bar1>>("select 1 as Id, 2 as BarId, 3 as BarId, 'a' as Name",(f,b)=>Tuple.Create(f,b),splitOn:"BarId").First();
varresult=connection.Query<Foo1,Bar1,Tuple<Foo1,Bar1>>("select 1 as Id, 2 as BarId, 3 as BarId, 'a' as Name",Tuple.Create,splitOn:"BarId").First();
result.Item1.Id.IsEqualTo(1);
result.Item1.BarId.IsEqualTo(2);
...
...
@@ -2534,7 +2533,7 @@ public void TestCustomTypeMap()