Entity Framework get properties including some values
<p>I have a method which iterates through all the properties of an object. I am logging those properties:</p>

<pre><code>Object obj = entry.Entity;
Type type = obj.GetType();
PropertyInfo[] properties = type.GetProperties();

 foreach (PropertyInfo property in properties)
 {
     oldData.AppendFormat("{0}={1} || ", property.Name, property.GetValue(obj, null));
 }
</code></pre>

<p>Now this is working fine but on my table log, it is also writing this properties below:</p>

<pre><code>- PremiumReference=System.Data.Objects.DataClasses.EntityReference`1[Data.Premium]
- EntityState=Deleted
- EntityKey=System.Data.EntityKey
</code></pre>

<p>Any ideas how I can filter this properties?</p>