Hello, I have a LINQ query:
And I want to pass it to a function to filter it, like this:
How can I pass "MyField" to the Sub and make the LINQ "Where" clause work?
Is there any workaround?
Thank you.
Code:
Dim Db = New MyDataContext
Dim Qry = From cust in Db.Customers
Select cust.ID, cust.Name
Code:
FilterQuery(Qry, ID) ... Sub FilterQuery(ByVal MyQry as iQueryable, MyField as ???) MyQry = MyQry.Where(MyField = "somevalue") End Sub
Is there any workaround?
Thank you.