Browse Source

4.2.1.7

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
1f761dc4e0
  1. 1
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableAccessory.cs
  2. 15
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  3. 4
      Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs

1
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableAccessory.cs

@ -10,5 +10,6 @@ namespace SqlSugar
public class QueryableAccessory public class QueryableAccessory
{ {
protected ILambdaExpressions _LambdaExpressions; protected ILambdaExpressions _LambdaExpressions;
protected bool _RestoreMapping = true;
} }
} }

15
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -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;
} }

4
Src/Asp.Net/SqlSugar/Properties/AssemblyInfo.cs

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.2.1.6")] [assembly: AssemblyVersion("4.2.1.7")]
[assembly: AssemblyFileVersion("4.2.1.6")] [assembly: AssemblyFileVersion("4.2.1.7")]

Loading…
Cancel
Save