我有一个 (PatchFacilityManager) 列表和一个 (Int) facilityManagerId 的列表。我想让下面的代码更加高效。是否有任何方法可以删除这两个 foreach 循环。
foreach (PatchFacilityManager PM in patchFacilityManager)
{
foreach (int FM in facilityManagerId)
{
if (PM.FacilityManagerId == FM)
{
PM.IsSelected = true;
}
}
}