I have a simple LINQ query that is going against a collection.
Dim oList = From w In Os
Order By w.ClassTitle Descending
Select w
What I’d like to be able to do though is pass into this whether it’s descending or ascending. I’m not sure how to do that.
Also, if I were to have a where clause in here.. say
where w.ClassTitle = "Test"
How can I make the “Test so that I can pass it into the LINQ query.
Thanks
shannon
I dont think you can pass that “into” this query, however you could do the regular query
Then when the user takes some action you could simply do an order by after that fact.
or
UPDATE:
As far as the late binding, what you could do is write a method that would execute the Where clause. Perhaps using an extension method might work. I’m more familiar with C# so my syntax might be a bit off
Then to call it like so: