如果我具有列表的静态初始化:
var list = new[]
{
new { Username = "Falcore", Score = 1293, },
new { Username = "Dunsby", Score = 2342, },
new { Username = "Habisham", Score = 5234, },
};
如何动态声明和填充这样的列表?即错误的伪代码:
var list = new[] {};
list.Add(new { Username = "Falcore", Score = 1293, });