var StudentDetail = new {ID=0, FirstName="", MiddleName="", LastName="", Age=1, Sex=''};
var StudentRecords = TypeGenerator.MakeList(StudentDetail)
StudentRecords.Add(new
{
ID = 1,
FirstName = "Sankar",
LastName = "Manickam",
MiddleName = "P",
Age = 25,
Sex = "M"
});
public static class TypeGenerator
{
public static List <T> MakeList <T>(this T t)
{
return new List <T>();
}
}
Wednesday, October 14, 2009
Create collection of Anonymous Types and also call Extension Methods.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment