mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update QueryableByObject
This commit is contained in:
parent
267e3954a7
commit
207e70b725
@ -105,7 +105,7 @@ namespace SqlSugar
|
||||
}
|
||||
public QueryMethodInfo Where(string sql, object parameters = null)
|
||||
{
|
||||
var method = QueryableObj.GetType().GetMyMethod("Where", 2, typeof(string), typeof(object));
|
||||
var method = QueryableObj.GetType().GetMyMethodNoGen("Where", 2, typeof(string), typeof(object));
|
||||
this.QueryableObj = method.Invoke(QueryableObj, new object[] { sql, parameters });
|
||||
return this;
|
||||
}
|
||||
|
@ -39,6 +39,14 @@ namespace SqlSugar
|
||||
it.GetParameters().First().ParameterType == parameterType&&
|
||||
it.GetParameters()[1].ParameterType == parameterType2) ;
|
||||
}
|
||||
|
||||
public static MethodInfo GetMyMethodNoGen(this Type type, string name, int argCount, Type parameterType, Type parameterType2)
|
||||
{
|
||||
return type.GetMethods().Where(it => it.Name == name&&it?.GetGenericArguments()?.Count()==0).FirstOrDefault(it =>
|
||||
it.GetParameters().Length == argCount &&
|
||||
it.GetParameters().First().ParameterType == parameterType &&
|
||||
it.GetParameters()[1].ParameterType == parameterType2);
|
||||
}
|
||||
public static MethodInfo GetMyMethod(this Type type, string name, int argCount, Type parameterType, Type parameterType2, Type parameterType3)
|
||||
{
|
||||
return type.GetMethods().Where(it => it.Name == name).FirstOrDefault(it =>
|
||||
|
Loading…
Reference in New Issue
Block a user