using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace SqlSugar { public class InsertMethodInfo { internal SqlSugarProvider Context { get; set; } internal MethodInfo MethodInfo { get; set; } internal object objectValue { get; set; } public int ExecuteCommand() { if (Context == null) return 0; var inertable=MethodInfo.Invoke(Context, new object[] { objectValue }); var result= inertable.GetType().GetMethod("ExecuteCommand").Invoke(inertable,new object[] { }); return (int)result; } public async Task ExecuteCommandAsync() { if (Context == null) return 0; var inertable = MethodInfo.Invoke(Context, new object[] { objectValue }); var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { }); return await (Task)result; } public int ExecuteReturnIdentity() { if (Context == null) return 0; var inertable = MethodInfo.Invoke(Context, new object[] { objectValue }); var result = inertable.GetType().GetMethod("ExecuteReturnIdentity").Invoke(inertable, new object[] { }); return (int)result; } public async Task ExecuteReturnIdentityAsync() { if (Context == null) return 0; var inertable = MethodInfo.Invoke(Context, new object[] { objectValue }); var result = inertable.GetType().GetMethod("ExecuteReturnIdentityAsync").Invoke(inertable, new object[] { }); return await (Task)result; } } }