我有一個包含5個成員的課程。 那樣:使用LINQ在課堂上更新成員
class Demo
{
public int id;
public string name;
public string color;
public int 4th_member;
public int 5th_member;
}
我有這個類的列表。
爲4th_member
和5th_member
,我有2個int鍵和int值的字典列表。 (一個爲第四個,第二個爲第五個)
根據字典,我想更新這些成員。 like,如果字典的key = id,則更新4th_member
爲Dictionary的值。
我希望我的問題已經夠清楚了。
爲什麼你堅持使用LINQ,當縮寫代表的查詢*語言* ... –