mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update : DeleteableByObject UpdateableByObject InsertableByObject
This commit is contained in:
@@ -24,7 +24,7 @@ namespace SqlSugar
|
||||
{
|
||||
if (Context == null) return 0;
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { });
|
||||
var result = inertable.GetType().GetMyMethod("ExecuteCommandAsync",0).Invoke(inertable, new object[] { });
|
||||
return await(Task<int>)result;
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ namespace SqlSugar
|
||||
{
|
||||
if (Context == null) return 0;
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { });
|
||||
var result = inertable.GetType().GetMyMethod("ExecuteCommandAsync",0).Invoke(inertable, new object[] { });
|
||||
return await (Task<int>)result;
|
||||
}
|
||||
public int ExecuteReturnIdentity()
|
||||
|
@@ -25,7 +25,7 @@ namespace SqlSugar
|
||||
{
|
||||
if (Context == null) return 0;
|
||||
var inertable = MethodInfo.Invoke(Context, new object[] { objectValue });
|
||||
var result = inertable.GetType().GetMethod("ExecuteCommandAsync").Invoke(inertable, new object[] { });
|
||||
var result = inertable.GetType().GetMyMethod("ExecuteCommandAsync",0).Invoke(inertable, new object[] { });
|
||||
return await (Task<int>)result;
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -9,6 +11,10 @@ namespace SqlSugar
|
||||
{
|
||||
public static class CommonExtensions
|
||||
{
|
||||
public static MethodInfo GetMyMethod(this Type type,string name, int argCount)
|
||||
{
|
||||
return type.GetMethods().FirstOrDefault(it => it.Name == name && it.GetParameters().Length == argCount);
|
||||
}
|
||||
public static List<T> ToList<T>(this T thisValue,Func<T,T> action) where T:class,new()
|
||||
{
|
||||
return new List<T> { thisValue };
|
||||
|
Reference in New Issue
Block a user