typescript
1name = "" 2type = "" 3priority = "" 4let id = 2 5 6for (let row of list) { 7 if (row.id == this.id) { 8 this.name = row.name 9 this.type = row.type 10 if (row.priority == 0) { 11 this.priority = "高" 12 } else if (row.priority == 1) { 13 this.priority = "中" 14 } else { 15 this.priority = "低" 16 } 17 } 18 }
このforeachをlinkで表現したいです...
typescript
1if (Enumerable.asEnumerable(list).Where((row) => row.id == this.id))
この続きにthis.name=row.nameみたいな処理を書く感じでしょうか(>_<)
しかし書き方が分からないです...
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/02/05 08:48
2018/02/05 08:53