title: Check data from Database against Entity Framework
body: <p>I have the problem that my database can contain invalid values that come from a previous version of the software. For these values we have to decide individually how to handle them.</p>
  <p>I have created a corresponding Entity Framework that can be used to access the database. Internally on the test systems everything worked as well, but during the first test installation on a customer system the program always crashed due to the invalid values in the database.</p>
  <p>Now the question is can I detect the errors in the database using the Entity Framework?</p>
  <p>I would like to know in which records, which columns lead to errors.</p>
  <p>I can't assume any Keys to get each Entity on its own. So my first idea was to check each repository (<code>DbSet</code>) from the <code>DbContext</code> for each entity (<code>QueryingEnumerable</code>). However, with <code>DbSet</code> you can't really access a single entity, you can only go through the query until the first error occurs.</p>
  <p>Also, I still don't know which columns led to the error since the exceptions don't contain any information.</p>
  <p>Any suggestions what else I can try?</p>