ZZZ Code AI
Report Issues
Suggest Features
Login
EF Core Tools
Chat
Code Explain
More Tools
How to automatically update the database after a model changes in EF Core?
<p>EF Core doesn't automatically update the database. A migration script must manually be <a href="https://www.learnentityframeworkcore.com/migrations#creating-a-migration">created</a></p> <p>Once created, you can automatically apply the migration script when the application starts with the <code>Migrate</code> method.</p> <pre><code class="language-csharp">context.Database.Migrate(); </code></pre> <p>Or manually <a href="https://www.learnentityframeworkcore.com/migrations#ef-core-update-database">update your database</a></p>
Sponsored by
Entity Framework Extensions
This field is required
A text with a minimum of 10 characters is required
Send
Legal & Licensing
Answer generated by AI may produce inaccurate information about code, people, facts, and more.
Advertising Break!
5
seconds left
Did you know...
That you can now sponsor this project on
GitHub
?