- 增加 InsertDict ExecuteIdentity 重载指定自增列;

This commit is contained in:
2881099
2023-10-31 11:40:15 +08:00
parent f83331c8f6
commit 52bc16d7c9
2 changed files with 9 additions and 2 deletions

View File

@ -15,6 +15,7 @@ using System.Drawing;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Security.Principal;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@ -1069,7 +1070,13 @@ SELECT ");
}
public int ExecuteAffrows() => _insertProvider.ExecuteAffrows();
public long ExecuteIdentity() => _insertProvider.ExecuteIdentity();
public long ExecuteIdentity(string identityColumn = null)
{
if (_insertProvider._table.ColumnsByCs.TryGetValue(identityColumn, out var col) == false)
throw new Exception(CoreStrings.GetPrimarys_ParameterError_IsNotDictKey(identityColumn).Replace(nameof(ExecuteIdentity), ""));
col.Attribute.IsIdentity = true;
return _insertProvider.ExecuteIdentity();
}
public List<Dictionary<string, object>> ExecuteInserted() => _insertProvider.ExecuteInserted();
#if net40