1
我有TypeScript代码,我需要在C#中的等效代码。在C#中的TypeScript“地图”功能?
声明:
private sessionCommands: SessionCommand[];
// . . .
// Create array in constructor.
this.sessionCommands = new Array();
// . . .
// Push few objects to array in some method
,然后得到的数据。这是重要的一部分,如何在C#中做到这一点?
var data = this.sessionCommands.map(x => x.identifier + " " + x.getParameter() + ";").join("\n");
这是LINQ的选择方法。 – Evk
而不是显示TypeScript代码,描述你想要实现的内容会更有用。这样,你不依赖于同时知道TypeScript *和* C#的读者。我的猜测是,你只是从LINQ寻找'Select'方法... –
我正在从类型脚本进行迁移。我不是100%确定我在做什么:) – Raskolnikov