Recently, one of my colleagues got a requirement of inserting data into a database using EF. His issue was - how to verify if the database schema is proper, or say, all the columns in the tables matched with his POCO entities. I bet a few of you must have come across similar scenarios.
Here is a quick solution to this.
In such scenarios, developers can perform a schema compatibility check prior to inserting any data into the columns in order to ensure that the model class still holds good with database tables.
- bool isModelValid = yourContext.Database.CompatibleWithModel(true);
Isn’t it a useful tip?

Ritika GoswamiPosted Aug 13, 2019, 3:16 AM
Interesting information sharing really helpful it is worth reading post thanks for it keep sharing https://www.exltech.in/dot-net-training.html
Ibrahim SiddiquePosted Jan 24, 2018, 10:01 AM
Helpful information