How do I access an anonymous object's properties outside its scope?

前端 未结 4 1078
终归单人心
终归单人心 2021-01-25 19:08

Scope might not be the right word. With the following code I can\'t get access to the collections element\'s object\'s properties. Is there a better return data type or a way t

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-25 19:45

    Use IEnumerable instead.

    According to msdn "The dynamic type enables the operations in which it occurs to bypass compile-time type checking. Instead, these operations are resolved at run time. The dynamic type simplifies access to COM APIs such as the Office Automation APIs, and also to dynamic APIs such as IronPython libraries, and to the HTML Document Object Model (DOM)."

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

提交回复
热议问题