Linked Questions

Popular Questions

Entity Framework Core 2.2 : Disable migrations for specific entities

Asked by At

I'm trying to build an aspnetcore application over an existing system where the database is already created, and I'm going to add some tables over it.

I've reverse engineered the database to add the existing tables as entities to my application, and I've written my own entities that will be added later. Finally, all the entities are added to a single DbContext.

My requirement comes as follows:

  • I want to enable code first migrations for the newly added entities
  • I don't want the migrations to occur for the already existing tables/entities

Note: I prefer not to touch the generated migration code.

Is there a proper way to handle this scenario?

Related Questions