I\'m triying to make a function that add a \'where\' clause to a query based in a property and a value. This is a very simplefied version of my function.
Pri
Have you tried pulling out the DirectCast and reflecting on the lambda parameter instead? Something like this:
DirectCast
query.Where(Function(c) _ c.GetType().GetProperty(p, GetType("Int64")).GetValue(c, Nothing) = PValue)
I'm not certain you can even do this sort of thing in a lambda, but it's worth a shot.