In order to make sure the above code works, you should indicate or define in what terms can two objects (in this case, the element of BoundingPolygonVertices, i.e. a Pt2D object). To do so, the Pt2D class should derive from IEquatable: