Invalid Column name when using savechanges() in entity framework
<p>So here is the deal, I have changed my database schema, and changed the PK for one of my tables and I have removed everything related to the old PK (FK reference in another tables). </p>

<p>However I have this exception when I insert a new entity using savechanges() method</p>

<blockquote>
  <p>ex = {"An error occurred while updating the entries. See the inner exception for details."}</p>
</blockquote>

<p>And the inner exception is </p>

<blockquote>
  <p>InnerException = {"Invalid column name 'Audit_ID'."}</p>
</blockquote>

<p>the Audit_ID is the old PK. </p>

<p>I have tried this
<a href="https://stackoverflow.com/questions/38051646/invalid-column-name-when-trying-to-insert-data-into-database-using-sql?rq=1">&quot;Invalid column name&quot; when trying to insert data into database using SQL</a></p>

<p>this <a href="https://stackoverflow.com/questions/9490484/invalid-column-name-when-trying-to-add-an-entity-to-a-database-using-dbcontext">Invalid column name when trying to add an entity to a database using DbContext</a></p>

<p>this <a href="https://stackoverflow.com/questions/8683482/invalid-column-name-after-mapping">Invalid column name after mapping</a></p>

<p>and nothing solved my issue, so as I deleted my whole edmx and created a new one also it didn't work. </p>

<p>ps: I am using database first approach  </p>