How to access items in a dynamic list?
I am trying to figure out how to enumerate the results from a dynamic LINQ .Select(string selectors) in .NET 4.5. The dynamic linq comes from the System.Linq.Dynamic namespace. Edit: I am also including System.Linq . I have a method that looks like this: public void SetAaData(List<T> data, List<string> fields) { if (data == null || data.Count == 0) { return; } var dynamicObject = data.AsQueryable().Select("new (" + string.Join(", ", fields) + ")"); _aaData = dynamicObject; } If I step through the code, I can examine dynamicObject and enumerate it to view the results (which are correct). The