emp_db_snapshot
- 从数据库什么的用户在过去已经选择的新副本加载:
emp_selected_by_user
- 用户选择的列表,用户可以改变已经选择的或者可以添加更多列表,可以从列表中删除:
//let say i have two rows in the list.
List<Employee> emp_db_snapshot = new List<Employee>();
emp_db_snapshot = EmployeeListFromDB ; //loads the list from db
//let say i have two rows in the list.
List<Employee> emp_selected_by_user = new List<Employee>();
emp_selected_by_user = MySelectedEmployee //loads the list selected by user.
//merging the two lists:
//got total of 4 rows.
List<Employee> allEmployee = emp_db_snapshot.Union(emp_selected_by_user).ToList();
所以我的问题是:
我怎样才能区分或比较?
我不确定您在区分方面寻找什么。你想排除重复吗?或者可能找出哪两个列表中存在哪些? –
@Brian:听起来像他希望能够检查结果列表allEmployee,并确定每个项目的来源 - 数据库或由用户选择。 – Yuck
请不要问同样的问题,而不是跟随你的初始问题。 – R0MANARMY