From 8c0e2177e6f1ae3a2d21cb51dd24458c9ba41bdb Mon Sep 17 00:00:00 2001 From: luoyunchong Date: Fri, 17 Sep 2021 18:56:44 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E4=BD=BF=E7=94=A8=20insertorupdate>=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E5=8F=8B=E5=A5=BD?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/Internal/CommonProvider/InsertOrUpdateProvider.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FreeSql/Internal/CommonProvider/InsertOrUpdateProvider.cs b/FreeSql/Internal/CommonProvider/InsertOrUpdateProvider.cs index ef66c502..86f228ce 100644 --- a/FreeSql/Internal/CommonProvider/InsertOrUpdateProvider.cs +++ b/FreeSql/Internal/CommonProvider/InsertOrUpdateProvider.cs @@ -37,6 +37,10 @@ namespace FreeSql.Internal.CommonProvider _commonUtils = commonUtils; _commonExpression = commonExpression; _table = _commonUtils.GetTableByEntity(typeof(T1)); + if (_table == null) + { + throw new Exception($"InsertOrUpdate<>的泛型参数 不支持 {typeof(T1)},请传递您的实体类"); + } if (_orm.CodeFirst.IsAutoSyncStructure && typeof(T1) != typeof(object)) _orm.CodeFirst.SyncStructure(); IdentityColumn = _table.Primarys.Where(a => a.Attribute.IsIdentity).FirstOrDefault(); }