This article is a mirror article of machine translation, please click here to jump to the original article.

View: 36475|Reply: 1

[Source] Allow Entity Framework to start no longer valid __MigrationHistory table

[Copy link]
Posted on 10/19/2016 1:40:14 PM | | |

In Entity Framework, when DbContext is loaded for the first time, OnModelCreating will check the __MigrationHistory table, as a programming mode using Code Frist, and when there is a database first, this detection is redundant, so it needs to be blocked, and before EF 4.1, you can use the following statement in the OnModelCreating function to block this detection:




After 4.3, the above statements are explicitly deprecated by MSDN, so they need to be replaced in a new way:


Everything is fine with the new EF!




Previous:EF Code Frist updates from the entity model to the database
Next:The number of tables and the table names in the statistical database in Mssql and Oracle
 Landlord| Posted on 2/7/2021 3:08:50 PM |
Database initialization strategy in EF 6 Code-First
https://www.itsvse.com/thread-7441-1-1.html

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com