mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Update InsertByObject UpdateByObject DeleteByObject
This commit is contained in:
@@ -27,5 +27,16 @@ namespace SqlSugar
|
||||
var result = inertable.GetType().GetMyMethod("ExecuteCommandAsync",0).Invoke(inertable, new object[] { });
|
||||
return await(Task<int>)result;
|
||||
}
|
||||
|
||||
public CommonMethodInfo SplitTable()
|
||||
{
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
|
||||
var result = newMethod.Invoke(inertable, new object[] { });
|
||||
return new CommonMethodInfo()
|
||||
{
|
||||
Context = result
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class CommonMethodInfo
|
||||
{
|
||||
internal object Context { get; set; }
|
||||
|
||||
public int ExecuteCommand()
|
||||
{
|
||||
if (Context == null) return 0;
|
||||
var result = Context.GetType().GetMyMethod("ExecuteCommand", 0).Invoke(Context, new object[] { });
|
||||
return (int)result;
|
||||
}
|
||||
public async Task<int> ExecuteCommandAsync()
|
||||
{
|
||||
if (Context == null) return 0;
|
||||
var result = Context.GetType().GetMyMethod("ExecuteCommandAsync", 0).Invoke(Context, new object[] { });
|
||||
return await (Task<int>)result;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -41,5 +41,15 @@ namespace SqlSugar
|
||||
var result = inertable.GetType().GetMyMethod("ExecuteReturnIdentityAsync",0).Invoke(inertable, new object[] { });
|
||||
return await (Task<int>)result;
|
||||
}
|
||||
public CommonMethodInfo SplitTable()
|
||||
{
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
|
||||
var result = newMethod.Invoke(inertable, new object[] { });
|
||||
return new CommonMethodInfo()
|
||||
{
|
||||
Context = result
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -28,5 +28,16 @@ namespace SqlSugar
|
||||
var result = inertable.GetType().GetMyMethod("ExecuteCommandAsync",0).Invoke(inertable, new object[] { });
|
||||
return await (Task<int>)result;
|
||||
}
|
||||
|
||||
public CommonMethodInfo SplitTable()
|
||||
{
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var newMethod = inertable.GetType().GetMyMethod("SplitTable", 0);
|
||||
var result = newMethod.Invoke(inertable, new object[] { });
|
||||
return new CommonMethodInfo()
|
||||
{
|
||||
Context = result
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user