mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Update ExpressionBuilderHelper
This commit is contained in:
@@ -12,6 +12,27 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public class ExpressionBuilderHelper
|
public class ExpressionBuilderHelper
|
||||||
{
|
{
|
||||||
|
public static object CallFunc(Type type, object[] param, object methodData, string methodName)
|
||||||
|
{
|
||||||
|
MethodInfo mi = methodData.GetType().GetMethod(methodName).MakeGenericMethod(new Type[] { type });
|
||||||
|
var ret = mi.Invoke(methodData, param);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
public static T CallFunc<T>(object param, object methodData, string methodName)
|
||||||
|
{
|
||||||
|
Type type = param.GetType();
|
||||||
|
MethodInfo mi = methodData.GetType().GetMethod(methodName).MakeGenericMethod(new Type[] { type });
|
||||||
|
var ret = mi.Invoke(methodData, new object[] { param });
|
||||||
|
return (T)ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T CallStaticFunc<T>(object param, Type methodType, string methodName)
|
||||||
|
{
|
||||||
|
Type type = param.GetType();
|
||||||
|
MethodInfo mi = methodType.GetMethod(methodName).MakeGenericMethod(new Type[] { type });
|
||||||
|
var ret = mi.Invoke(null, new object[] { param });
|
||||||
|
return (T)ret;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create Expression
|
/// Create Expression
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user