Anonymous Types

前端 未结 5 889
北恋
北恋 2021-01-12 17:41

I have a Dictionary(TKey, TValue) like

Dictionary Deduction_Employees = 
    new Dictionary();

5条回答
  •  不要未来只要你来
    2021-01-12 18:08

    An anonymous type has method scope. To pass an anonymous type, or a collection that contains anonymous types, outside a method boundary, you must first cast the type to object. However, this defeats the strong typing of the anonymous type. If you must store your query results or pass them outside the method boundary, consider using an ordinary named struct or class instead of an anonymous type.

    Source: http://msdn.microsoft.com/en-us/library/bb397696.aspx

提交回复
热议问题