title: How to distinguish Navigation Properties from regular ones when using GetProperties?
body: <p>Is there a way to distinguish between a regular collection property and a navigation property on an Entity-Framework class (Database-First)?</p>
  
  <p>I'm currently checking if the object <code>is ICollection</code> and <code>IsVirtual</code> but I feel this could possibly trigger on a regular property that someone has declared as a virtual collection. </p>
  
  <p><strong>Question:</strong> Are there any other ways to distinguish Navigation Properties from others?</p>
  
  <p><strong>Context</strong>: I'm using this to compare values of any object, but I want it to ignore navigation properties (to ignore circular-references among other things).</p>
  
  <pre><code>foreach (var item in (IEnumerable)obj)
  {
      list2.MoveNext();
      var item2 = list2.Current;
      foreach (PropertyInfo propInfo in item.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
      {
          Object v1 = propInfo.GetValue(item);
          Object v2 = propInfo.GetValue(item2);
  
          Primitive = (v1 == null &amp;&amp; v2 == null) || IsPrimitive(v1.GetType());
  
          if (Primitive)
          {
              Assert.AreEqual(v1, v2);
          }
          else
          {
              // Ignore Navigation Properties
              // Currently assuming Virtual properties to be Navigation...
              if (propInfo.GetGetMethod().IsVirtual) continue;
              CompareObjects(v1, v2);
          }
      }
  }
  </code></pre>