How can be possible to use anonymous type fields without know them ?

Posted by Freshblood on Stack Overflow See other posts from Stack Overflow or by Freshblood
Published on 2010-06-13T14:47:52Z Indexed on 2010/06/13 14:52 UTC
Read the original article Hit count: 418

Filed under:
|
|

Hello everybody

It is really looks so cool to me how GridView's DataSource property gets anonymous type and shows results in Grid .

Simply

Grid.DataSource = from order in db.OrdersSet
       select new { order.PersonSet.Name,order.PersonSet.SurName};

How this mechanism work? how can i do something like this ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET