Here is the Actual Implementation would look like without reflection :
IEnumerable<Foo> SelectWrapper(ExpressionNode orderClause)
{
var data = context.Select<Foo>(new IClause<Foo>[]{new Clause<Foo, int> (orderClause)});
return data;
}
But I have a generic method like below, I have been provided with unknown type t which will be Foo at runtime, so I tried like this :
IEnumerable<Type> SelectWrapper(Type t, ExpressionNode orderClause)
{
MethodInfo getSelect = typeof(RepoClass).GetMethod("Select");
MethodInfo genericSelect = getSelect.MakeGenericMethod(t);
generic.Invoke(......); //how to invoke generic parameters here with generic method
//....
return someValue;
}
So my question is : Whats the possible way to implement this code via reflection ?
Many Thanks..