相关疑难解决方法(0)

声明匿名类型列表

有没有办法声明匿名类型的列表对象.我的意思是

List<var> someVariable = new List<var>();
someVariable.Add(
             new{Name="Krishna", 
                 Phones = new[] {"555-555-5555", "666-666-6666"}}
                );
Run Code Online (Sandbox Code Playgroud)

这是因为我需要在运行时创建一个集合.提前致谢

c# asp.net anonymous-types c#-3.0

74
推荐指数
7
解决办法
9万
查看次数

标签 统计

anonymous-types ×1

asp.net ×1

c# ×1

c#-3.0 ×1