MySql Queryable.Take Bug

This commit is contained in:
sunkaixuan
2017-07-14 12:09:52 +08:00
parent f24f6e88cb
commit 59e49827a5
3 changed files with 3 additions and 2 deletions

View File

@@ -153,6 +153,7 @@ namespace OrmTest.Demo
{
var db = GetInstance();
var getAll = db.Queryable<Student>().ToList();
var getTop2 = db.Queryable<Student>().Take(2).ToList();//TOP2
var getLike = db.Queryable<Student>().Where(it => it.Name.Contains("a")).ToList();
var getAllOrder = db.Queryable<Student>().OrderBy(it => it.Id).OrderBy(it => it.Name, OrderByType.Desc).ToList();
var getId = db.Queryable<Student>().Select(it => it.Id).ToList();

View File

@@ -48,7 +48,7 @@ namespace SqlSugar
else if (Skip == null && Take != null)
{
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
result = string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, 1, Take.ObjToInt());
result = string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, 0, Take.ObjToInt());
}
else if (Skip != null && Take != null)
{

View File

@@ -48,7 +48,7 @@ namespace SqlSugar
else if (Skip == null && Take != null)
{
if (this.OrderByValue == "ORDER BY ") this.OrderByValue += GetSelectValue.Split(',')[0];
result= string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, 1, Take.ObjToInt());
result= string.Format(PageTempalte, GetSelectValue, GetTableNameString, GetWhereValueString, GetGroupByString + HavingInfos, GetOrderByString, 0, Take.ObjToInt());
}
else if (Skip != null && Take != null)
{