The short story: I want to convert a list/dictionary into an anonymous object
Basically what I had before was:
var model = from item in IEnumerable<Item>
select new
{
name = item.Name
value = item.Value
}
etc.
If I have name, item.Name
in a list or dictionary, how can I go about creating the same anonymous object model
?
Edit: Clarification:
If the dictionary contains [name, item.Name]
and [value, item.Value]
as Key Value pairs, how would I go about creating the model
without assuming that you know neither name
nor value
?