Tag Archives: Entity Framework

Trouble with Keys

I’ve just spent a couple of hours scratching my head with database/entity framework problem. My client has a requirement to duplicate records from one database to another when the first is updated. The tables were identical and based on a class inherited … Continue reading

Posted in Development, EntityFramework | Tagged | Leave a comment

Entity Framework and recreating the database when the model changes.

I’ve just started a new MVC5 project, and just couldn’t remember exactly how to do this. So: Create a new project Create your models Create your DbContext Create a Database Initializer Add Database Initializer into Global.asax public class ApplicationDbContextInitializer : … Continue reading

Posted in Development | Tagged , | Leave a comment

Entity Framework v6 – Multiple Migrations

I love the that EF6 now allows managing migrations for multiple data contexts. This is great as it allows segregation of data tables into their own ‘domains’. If we have a website called VideoStore, and two data contexts, one for … Continue reading

Posted in Development | Tagged , , , | Leave a comment