UpdateByObject ExecuteCommandWithOptLock

This commit is contained in:
sunkaixuan
2024-07-05 13:07:26 +08:00
parent 4d6f0af01c
commit 74d559ba9f

View File

@@ -13,6 +13,21 @@ namespace SqlSugar
internal MethodInfo MethodInfo { get; set; }
internal object objectValue { get; set; }
public int ExecuteCommandWithOptLock(bool isThrowError = false)
{
if (Context == null) return 0;
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var result = inertable.GetType().GetMyMethod("ExecuteCommandWithOptLock",1,typeof(bool)).Invoke(inertable, new object[] { isThrowError });
return (int)result;
}
public async Task<int> ExecuteCommandWithOptLockAsync(bool isThrowError = false)
{
if (Context == null) return 0;
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
var result = inertable.GetType().GetMyMethod("ExecuteCommandWithOptLockAsync", 1, typeof(bool)).Invoke(inertable, new object[] { isThrowError });
return await(Task<int>)result;
}
public int ExecuteCommand()
{
if (Context == null) return 0;