Thursday, January 22, 2009

Object Initializer

var objList = (from info in someList
select new YourClassName
{
Property1 = info.Property1,
Property2 = info.Property2,
} into newInfo
select newInfo).AsEnumerable();

where YourClassName is the name of your class you want to initialize.And Property1, Property2 are properties inside the class.

0 comments:

Post a Comment