Return to Snippet

Revision: 35074
at November 2, 2010 04:10 by wallybh


Initial Code
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();

Initial URL
http://kirillosenkov.blogspot.com/2008/01/how-to-create-generic-list-of-anonymous.html

Initial Description
Enables to create a generic list with anonymous types. Very useful for me :).

Initial Title
Anonymous generic List

Initial Tags
list, c#

Initial Language
C#