mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-05 03:17:41 +08:00
UpdateByObject ExecuteCommandWithOptLock
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user