Actually, it is a closer duplicate of:
RemoveAll for ObservableCollections?
Possible Duplicate:
using LINQ to remove objects within a List<T>
This is the code I'm using, but its not very readable. Can I use LINQ to shorten the code below while still having the same functionality?
int index = 0;
int pos = 0;
foreach (var x in HomeViewModel.RecentPatients)
{
if (x.PID == p.PID)
pos = index;
else
index++;
}
HomeViewModel.RecentPatients.RemoveAt(pos);