I have an IQuerable<object> source object and have to get from it something like that (but using reflection).
source.Select(t => new SelectListItem { Name = t.Name, Value = t.Id })
How can I do that, or where can i find references of constructing that kind of expression tree.
Thanks
You can create
Expressions using theSystem.Linq.Expressionsnamespace ( MSDN )In your case, it would look something like this:
The you could use it like this: