重写数据库插入数据异常

This commit is contained in:
falcon 2022-04-19 09:45:50 +08:00
parent 8916196cf2
commit 48c6d1299c

View File

@ -46,8 +46,13 @@ namespace Falcon.SugarApi.DatabaseDefinitions
cn.CreateNew(createBy); cn.CreateNew(createBy);
} }
} }
try {
this.Insertable(data).ExecuteCommand(); this.Insertable(data).ExecuteCommand();
} }
catch (Exception ex) {
throw new Exception("SugarDbContext.Insert数据发生异常", ex);
}
}
/// <summary> /// <summary>
/// 在数据库中插入数据 /// 在数据库中插入数据