From 48c6d1299cdf91721ff19d729c2ca91cbb6f6f17 Mon Sep 17 00:00:00 2001 From: falcon <9504402@qq.com> Date: Tue, 19 Apr 2022 09:45:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=86=99=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E6=95=B0=E6=8D=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs b/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs index 329c2d5..99f586e 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/SugarDbContext.cs @@ -46,7 +46,12 @@ namespace Falcon.SugarApi.DatabaseDefinitions cn.CreateNew(createBy); } } - this.Insertable(data).ExecuteCommand(); + try { + this.Insertable(data).ExecuteCommand(); + } + catch (Exception ex) { + throw new Exception("SugarDbContext.Insert数据发生异常!", ex); + } } ///