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