I have a list collection of following type
CoordinateCollection pointCoordinates = new CoordinateCollection();
it adds up list of type vector. I want to remove duplicate entries from the list
I am trying like this
pointCoordinates = pointCoordinates.Distinct();
it gives me an error
cannot implicitly convert type 'system.collections.generic.ienumerable<SharpKML.Base.Vector> to SharpKML.Dom.CoordinateCollection
Please help me in solving this. I want unique set of records
Since
CoordinateCollection
implementsICollection<Vector>
andVector
overridesEquals
+GethashCode
you can useDistinct
. But you need to use the constructor ofCoordinateCollection
to create a new:Note that i'm not familiar with
SharpKML
, i have looked at it's source code.