I have a simple list of expando objects called products.
I add various fields to these objects at runtime (e.g. color or size)
How can I write a LINQ query in this list based on dynamic fields?
With a classic list of objects, I could write a LINQ query as follows:
From item in Products Where item.color="red" select item
but with expandos, how can this be achieved, knowing that I donβt know the names of the fields in advance (could it be the size of the weight or something else)?
Thanks in advance.
alainb
source share