title: Use Linq to detect circular dependency, string property
body: <p>Imagine an object like this</p>
  
  <pre><code>public class ContentType
  {
      public string Alias { get; set;}
      public string ParentAlias { get; set;}
  }
  </code></pre>
  
  <p>And a flat collection of these objects</p>
  
  <pre><code>List&lt;ContentType&gt; contentTypes...;
  </code></pre>
  
  <p>How can I use a linq chained syntax query to determine if there is a circular reference in the collection.  </p>
  
  <pre><code>//Example
  ContentType #50
  Alias: Truck
  ParentAlias: Vehicle
  
  ContentType #90
  Alias: Vehicle
  ParentAlias: Truck
  </code></pre>
  
  <p>That would be a circular dependency which would break the code that creates the content types (it would get stuck in an infinite loop walking the parent hierarchies..)</p>
  
  <p>So before I process the parent/child content types I would like to first detect if there is a circular dependency in the collection and halt the operation if one is detected.</p>