|
@ -490,8 +490,11 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
public virtual DataTable ToDataTablePage(int pageIndex, int pageSize, ref int totalNumber) |
|
|
public virtual DataTable ToDataTablePage(int pageIndex, int pageSize, ref int totalNumber) |
|
|
{ |
|
|
{ |
|
|
|
|
|
_RestoreMapping = false; |
|
|
totalNumber = this.Count(); |
|
|
totalNumber = this.Count(); |
|
|
return ToDataTablePage(pageIndex, pageSize); |
|
|
var result = ToDataTablePage(pageIndex, pageSize); |
|
|
|
|
|
_RestoreMapping = true; |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual List<T> ToList() |
|
|
public virtual List<T> ToList() |
|
@ -516,11 +519,15 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
public virtual List<T> ToPageList(int pageIndex, int pageSize, ref int totalNumber) |
|
|
public virtual List<T> ToPageList(int pageIndex, int pageSize, ref int totalNumber) |
|
|
{ |
|
|
{ |
|
|
|
|
|
_RestoreMapping = false; |
|
|
|
|
|
List<T> result = null; |
|
|
totalNumber = this.Count(); |
|
|
totalNumber = this.Count(); |
|
|
if (totalNumber == 0) |
|
|
if (totalNumber == 0) |
|
|
return new List<T>(); |
|
|
result = new List<T>(); |
|
|
else |
|
|
else |
|
|
return ToPageList(pageIndex, pageSize); |
|
|
result = ToPageList(pageIndex, pageSize); |
|
|
|
|
|
_RestoreMapping = true; |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual KeyValuePair<string, List<SugarParameter>> ToSql() |
|
|
public virtual KeyValuePair<string, List<SugarParameter>> ToSql() |
|
@ -671,7 +678,7 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
protected void RestoreMapping() |
|
|
protected void RestoreMapping() |
|
|
{ |
|
|
{ |
|
|
if (IsAs) |
|
|
if (IsAs && _RestoreMapping) |
|
|
{ |
|
|
{ |
|
|
this.Context.MappingTables = OldMappingTableList == null ? new MappingTableList() : OldMappingTableList; |
|
|
this.Context.MappingTables = OldMappingTableList == null ? new MappingTableList() : OldMappingTableList; |
|
|
} |
|
|
} |
|
|