I want to filter my List
and if an item
already exists, I don't want to add that item
to that List
. That's why I try to filter by the item
property.
if(!(PolyLineList.Contains(PolyLineList.Find(x => x.item == item))))
{
cPolyline currentPolyLine = new cPolyline(pointlist,item);
PolyLineList.Add(currentPolyLine);
}
When an item
already exists in PolyLineList
, that is equal to item
, it should skip the if
-statement.