Linq Enumerable to another Collection

given devices is an IEnumberable<> var nvc = devices.Aggregate(new NameValueCollection(), (seed, current) => { seed.Add("device", current.Id.ToString()); return seed; }); Json Array of objects to Dictionary, keyed (indexed) on chosen property using Json.Net; //Newtonsoft using Json.Net.Linq; public class Device { public int Id {get; set;} public string Name {get; set;} public string Property {get; set;} } var json = @"[{id: 1, name: ""name1"", prop: ""prop1""}, {id: 2, name: ""name2"", prop: ""prop""}]"; var devicesDictionary = JArray.

Json.Net Serialize Dictionary<Tkey, Tobject> to List<Tobject>

Motivation: Wanted convenience of a Dictionary on the server side MVC controller (for some key look-up based logic), yet send the same list of objects down to Knockout Ajax client, which most readily consumes lists as Javascript object arrays. Could’ve just exposed the List as another property but wanted to see if I could roll it all into one property just to learn a little more about the Json.Net API.Nice that Json.