I have a combo box in Silverlight. It has a collection of values built out of the properties of one of my LINQ-to-SQL objects (ie Name, Address, Age, etc...). I would like to filter my results based off the value selected in a combo box.
Example: Say I want everyone with a last name "Smith". I'd select 'Last Name' from the drop down list and enter smith into a textbox control. Normally I would write a LINQ query similar to...
var query = from p in collection
where p.LastName == textbox.Text
select p;
Is it possible to decide the property dynamically, maybe using Reflection? Something like
var query = from p in collection
where p.(DropDownValue) == textbox.Text
select p;