title: Finding duplicate properties inside two lists
body: <p>I have two lists, each list is of type &quot;Node&quot;. So I have a StartNodeList and an EndNodeList.</p>
  <p>Each Node consists of 3 properties of type Double... X, Y and Z.</p>
  <p>The StartNodeList and EndNodeList currently contain Nodes with identical property values.</p>
  <p>The output I need is a single list of type Node that contains only Nodes with unique property values (i.e. no duplicate Nodes).</p>
  <p>I have tried all manner of foreach loops and comparison operators that I can think of with varying levels of success with nothing working perfectly, and several hours of researching the problem online hasn't helped.</p>
  <p>Could someone please help me toward a solution?</p>
  <pre><code> while (selector.MoveNext())
          {
              Beam beam = selector.Current as Beam;
  
              if (beam != null)
              {
  
                  Node nodeEnd = new Node();
                  nodeEnd.x = beam.EndPoint.X;
                  nodeEnd.y = beam.EndPoint.Y;
                  nodeEnd.z = beam.EndPoint.Z;
  
  
                  Node nodeStart = new Node();
                  nodeStart.x = beam.StartPoint.X;
                  nodeStart.y = beam.StartPoint.Y;
                  nodeStart.z = beam.StartPoint.Z;
  
                  Member member = new Member() { member_start = nodeStart, member_end = nodeEnd, member_id = 1 };
  
                  memberList.Add(member);
  
                  nodeEndList.Add(nodeEnd);
                  nodeStartList.Add(nodeStart);
  
                  memberNumdber++;
              }
  
          }
  
          Console.WriteLine(nodeStartList.Count());
          Console.ReadLine();
  
          int count = nodeStartList.Count();
  
          foreach(Node i in nodeEndList)
          {
              nodeListSorted = EqualityComparer.Compare(i, nodeStartList);
          }
  </code></pre>
  <p>public static class EqualityComparer
  {</p>
  <pre><code>    public static List&lt;Node&gt; Compare(Node node, List&lt;Node&gt; list)
      {
          List&lt;Node&gt; output = new List&lt;Node&gt;();
          output.Add(node);
  
          foreach(Node i in list)
          {
  
              if (node.x.Equals(i.x) &amp;&amp; node.y.Equals(i.y) &amp;&amp; node.z.Equals(i.z))
              {
  
              }
  
              else
              {
                  output.Add(i);
              }
          }
  
          return output;
      }
  }
  </code></pre>