我有一个包含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,当缩写代表的查询*语言* ... –