From e7441526f2c303c8f7de4bad97bb29189c4e56a5 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 3 Jun 2023 19:36:31 +0800 Subject: [PATCH] Update db.InsertableByObject --- .../Abstract/DynamicBuilder/CommonMethodInfo.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/DynamicBuilder/CommonMethodInfo.cs b/Src/Asp.Net/SqlSugar/Abstract/DynamicBuilder/CommonMethodInfo.cs index de48a800c..bb75ceaff 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DynamicBuilder/CommonMethodInfo.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DynamicBuilder/CommonMethodInfo.cs @@ -8,8 +8,20 @@ namespace SqlSugar { public class CommonMethodInfo { - internal object Context { get; set; } + internal object Context { get; set; } + public int ExecuteReturnIdentity() + { + if (Context == null) return 0; + var result = Context.GetType().GetMyMethod("ExecuteReturnIdentity", 0).Invoke(Context, new object[] { }); + return (int)result; + } + public async Task ExecuteReturnIdentityAsync() + { + if (Context == null) return 0; + var result = Context.GetType().GetMyMethod("ExecuteReturnIdentityAsync", 0).Invoke(Context, new object[] { }); + return await (Task)result; + } public int ExecuteCommand() { if (Context == null) return 0;