mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-23 13:21:59 +08:00
Synchronization code
This commit is contained in:
@@ -70,18 +70,17 @@ namespace SqlSugar
|
||||
RestoreMapping();
|
||||
return new KeyValuePair<string, List<SugarParameter>>(sql, InsertBuilder.Parameters);
|
||||
}
|
||||
|
||||
public async Task<List<Type>> ExecuteReturnPkListAsync<Type>()
|
||||
{
|
||||
return await Task.Run(() => ExecuteReturnPkList<Type>());
|
||||
}
|
||||
public virtual List<Type> ExecuteReturnPkList<Type>()
|
||||
{
|
||||
var pkInfo= this.EntityInfo.Columns.FirstOrDefault(it => it.IsPrimarykey == true);
|
||||
Check.ExceptionEasy(pkInfo==null,"ExecuteReturnPkList need primary key", "ExecuteReturnPkList需要主键");
|
||||
Check.ExceptionEasy(this.EntityInfo.Columns.Count(it => it.IsPrimarykey == true)>1, "ExecuteReturnPkList ,Only support technology single primary key", "ExecuteReturnPkList只支技单主键");
|
||||
var isIdEntity = pkInfo.IsIdentity|| (pkInfo.OracleSequenceName.HasValue()&&this.Context.CurrentConnectionConfig.DbType==DbType.Oracle);
|
||||
if (pkInfo.UnderType == UtilConstants.LongType)
|
||||
{
|
||||
return InsertPkListLong<Type>();
|
||||
}
|
||||
else if (isIdEntity&&this.InsertObjs.Length==1)
|
||||
if (isIdEntity&&this.InsertObjs.Length==1)
|
||||
{
|
||||
return InsertPkListIdentityCount1<Type>(pkInfo);
|
||||
}
|
||||
@@ -93,6 +92,10 @@ namespace SqlSugar
|
||||
{
|
||||
return InsertPkListWithFunc<Type>(pkInfo);
|
||||
}
|
||||
else if (pkInfo.UnderType == UtilConstants.LongType)
|
||||
{
|
||||
return InsertPkListLong<Type>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return InsertPkListGuid<Type>(pkInfo);
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace SqlSugar
|
||||
int ExecuteCommand();
|
||||
Task<int> ExecuteCommandAsync();
|
||||
List<Type> ExecuteReturnPkList<Type>();
|
||||
Task<List<Type>> ExecuteReturnPkListAsync<Type>();
|
||||
long ExecuteReturnSnowflakeId();
|
||||
List<long> ExecuteReturnSnowflakeIdList();
|
||||
Task<long> ExecuteReturnSnowflakeIdAsync();
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return "EXECUTE sp_addextendedproperty N'MS_Description', '{1}', N'user', N'dbo', N'table', N'{0}', NULL, NULL";
|
||||
return "EXECUTE sp_addextendedproperty N'MS_Description', N'{1}', N'user', N'dbo', N'table', N'{0}', NULL, NULL";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user