【发布时间】:2011-07-13 10:47:03
【问题描述】:
我最近在 StackOverflow 上浏览 this question,看着接受的答案,我想知道实际的具体类型是什么
var ordinals = new {
Test1 = SomeFunctionReturningInt32("Test1"),
Test2 = SomeFunctionReturningInt32("Test2")
};
这会导致 MSIL 做什么?
【问题讨论】:
-
var type = ordinals.GetType();是编译时生成的。类型应该与您无关。
标签: .net anonymous-types