Anonymous generic List
Enables to create a generic list with anonymous types. Very useful for me :).
Copy this code and paste it in your HTML
var Customer1
= new { IdCustomer
= 1, FirstName
= "Eric", LastName
= "Clapton" }; var Customer2
= new { IdCustomer
= 2, FirstName
= "Kurt", LastName
= "Cobain" }; var Customer3
= new { IdCustomer
= 3, FirstName
= "John", LastName
= "Doe" };
var customerList
= (new[] { Customer1, Customer2, Customer3
}).ToList();
URL: http://kirillosenkov.blogspot.com/2008/01/how-to-create-generic-list-of-anonymous.html
Report this snippet
Comments
Subscribe to comments