Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 C# 中创建匿名对象,并且它的一些子对象也是对象。有可能在 C# 中做到这一点吗?(PS。我收到以下代码的一些提示错误)
var o = new { age = 123, child = { name = "asdffff"} };
你错过了“新”:
var o = new { age = 123, child = new { name = "asdffff"} };