是否可以在C#中的LINQ擴展方法中創建匿名類型?是否可以在C#中的LINQ擴展方法中創建匿名類型?
例如LINQ query.i.e。
var CAquery = from temp in CAtemp
join casect in CAdb.sectors
on temp.sector_code equals casect.sector_code
select new
{
//anonymous types
CUSIP = temp.equity_cusip,
CompName = temp.company_name,
Exchange = temp.primary_exchange
};
是否支持C#中LINQ擴展方法的相同行爲?
是的,是的,它是。 – 2013-05-09 17:05:42
顯然,如果你想在方法之間傳遞這些匿名對象,你可能會遇到麻煩。 – spender 2013-05-09 17:07:08
像[動態](http://msdn.microsoft.com/en-us/library/vstudio/dd264741.aspx)? – 2013-05-09 17:07:17