1
私は、arroundの20種類の一連の配列を持っている し、コードの表示だけastheticポイントは私が持っているものの代わりに、複数のコール.net上でforeachsを組み合わせる方法はありますか?
の1つのforeachがしたいのため:
foreach (var item in actionEvent.Colors)
UpdateComponent(item.ComponentId, item);
foreach (var item in actionEvent.Links)
UpdateComponent(item.ComponentId, item);
foreach (var item in actionEvent.Texts)
UpdateComponent(item.ComponentId, item);
それは労働組合のようなものが存在するかどうかは知らない私は
foreach (var item in actionEvent.Colors, actionEvent.Links,actionEvent.Texts)
UpdateComponent(item.ComponentId, item);
を持っているのが大好きだ
(他のコードを爆発させる配列があるのでactionEventを繰り返し処理することはできません)
こんにちはロブ、答えのためのおかげで、それは私のために働いていなかった、 最初の1 trhewこのエラー:System.Collections.Generic.List」をしません'Concat'の定義が含まれています " 第2のものはキャストと同じですが、 –
Saikios
@saikiosファイルの先頭に 'using System.Linq'を追加する必要があります。私は自分の机に戻ってきたときに投稿を編集します – Rob
私はそれを使用しています using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.Entity; System.Data.SqlClientを使用している ; using System.Data; – Saikios