Using two observal collction i want to remove items from matching same id with two collection...
Collections:
1. windows
2. windows size
My Code:
foreach (var heat in Settings.RoomViewModelCollection)
{
foreach (var room in heat.HeatTransmission)
{
if (room.Windows.Any(x => WindowSize.Any(y => y.WindowSizeId.Equals(x.WindowSizeId))))
{
heat.HeatTransmission.Remove(room);
break;
}
}
}
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Madan ShekarPosted Mar 21, 2019, 1:53 AM
Shanthosh SivaPosted Mar 21, 2019, 2:30 AM
i was tried same as your code but not going inside on foeachloop it was come ouside of loop and cannot catch the deleted items indide a loop.
list :
public List
Shanthosh SivaPosted Mar 21, 2019, 1:43 AM