title: Iterating over columns of database tables using entity framework
body: <p>I have a database which needs to be cleaned, yet I want to clean it dynamically. Each Table contains several fields and my requirement is that the "<code>Trim()</code>" function be applied to all "String" fields.</p>
  
  <p>Suppose I have two tables named <code>CustomerInfo</code> and <code>CustomerPayments</code>, My requirement is to first iterate over these tables and for each table, search for columns (fields) that have type of "<code>String</code>" and then apply the <code>Trim()</code> method to them.</p>
  
  <p>Can I do that with LINQ?</p>
  
  <p>I was using the following code to no avail since the <code>CustomerInfo</code> class generated by Entity Framework does not implements <code>GetProperties()</code>.</p>
  
  <pre><code>foreach (PropertyInfo propertyInfo in CustomerInfo.GetProperties())
  </code></pre>
  
  <p>Though I am truly in need of iterating table names in the base entity object as well.</p>