From 505100c8527a70c658476d0ba9408c59b2e5c3de Mon Sep 17 00:00:00 2001 From: 28810 <28810@YEXIANGQIN> Date: Sun, 19 Apr 2020 14:47:37 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0=20InsertProvider=20?= =?UTF-8?q?=E5=AF=B9=20InsertValueSql=20=E8=87=AA=E5=A2=9E=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E5=A4=84=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql.DbContext/FreeSql.DbContext.xml | 16 ---------------- .../Internal/CommonProvider/InsertProvider.cs | 4 ++-- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/FreeSql.DbContext/FreeSql.DbContext.xml b/FreeSql.DbContext/FreeSql.DbContext.xml index 8fd2938a..299c91e5 100644 --- a/FreeSql.DbContext/FreeSql.DbContext.xml +++ b/FreeSql.DbContext/FreeSql.DbContext.xml @@ -120,13 +120,6 @@ 清空状态数据 - - - 根据 lambda 条件删除数据 - - - - 添加 @@ -395,14 +388,5 @@ - - - 批量注入 Repository,可以参考代码自行调整 - - - - - - diff --git a/FreeSql/Internal/CommonProvider/InsertProvider.cs b/FreeSql/Internal/CommonProvider/InsertProvider.cs index 7780ba66..a88dbd19 100644 --- a/FreeSql/Internal/CommonProvider/InsertProvider.cs +++ b/FreeSql/Internal/CommonProvider/InsertProvider.cs @@ -501,7 +501,7 @@ namespace FreeSql.Internal.CommonProvider var colidx = 0; foreach (var col in _table.Columns.Values) { - if (col.Attribute.IsIdentity && _insertIdentity == false) continue; + if (col.Attribute.IsIdentity && _insertIdentity == false && string.IsNullOrEmpty(col.DbInsertValue)) continue; if (col.Attribute.IsIdentity == false && _ignore.ContainsKey(col.Attribute.Name)) continue; if (colidx > 0) sb.Append(", "); @@ -520,7 +520,7 @@ namespace FreeSql.Internal.CommonProvider var colidx2 = 0; foreach (var col in _table.Columns.Values) { - if (col.Attribute.IsIdentity && _insertIdentity == false) continue; + if (col.Attribute.IsIdentity && _insertIdentity == false && string.IsNullOrEmpty(col.DbInsertValue)) continue; if (col.Attribute.IsIdentity == false && _ignore.ContainsKey(col.Attribute.Name)) continue; if (colidx2 > 0) sb.Append(", ");