How does one create a .NET Expression with NodeType of ExpressionType.Index?

[亡魂溺海] 提交于 2019-12-05 18:41:00

An IndexExpression is exactly what you expect (i.e., array access or indexer property). It's one of the many new expression types that was ported over from the DLR. The C# 4.0 compiler, however, uses the same expression types as its previous version, so it won't use IndexExpression anywhere. Other languages may do so if their designers wish it.

To create an IndexExpression programmatically, use the static ArrayAccess(),MakeIndex(), or Property() methods on the Expression class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!