Update SqlServer

This commit is contained in:
sunkaixuan 2022-08-23 23:58:20 +08:00
parent 58f0b23f65
commit c535a76ee8
3 changed files with 5 additions and 6 deletions

View File

@ -108,8 +108,9 @@ namespace SqlSugar
}
else if (isIdEntity && this.InsertBuilder.ConvertInsertReturnIdFunc != null)
{
string sql = _ExecuteCommand();
InsertBuilder.IsReturnPkList = true;
InsertBuilder.IsNoPage = true;
string sql = _ExecuteCommand();
sql = this.InsertBuilder.ConvertInsertReturnIdFunc(SqlBuilder.GetTranslationColumnName(pkInfo.DbColumnName),sql);
var result = Ado.SqlQuery<Type>(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
After(sql, null);

View File

@ -31,6 +31,7 @@ namespace SqlSugar
public Dictionary<string, int> OracleSeqInfoList { get; set; }
public bool IsBlukCopy { get; set; }
public virtual bool IsOleDb { get; set; }
public virtual bool IsReturnPkList { get; set; }
#endregion
#region SqlTemplate

View File

@ -39,12 +39,9 @@ namespace SqlSugar
{
pageSize = 100;
}
if (IsNoPage)
if (IsNoPage && IsReturnPkList)
{
if(this.EntityInfo.Columns.Any(it => it.IsIdentity))
{
pageSize = groupList.Count;
}
pageSize = groupList.Count;
}
int pageIndex = 1;
int totalRecord = groupList.Count;