Reputation: 40
I have to create an application that will copy common configuration settings from one database to another database (same schema). I'm wondering if I can use one Entity Model to access both databases. Say it is stores and products that need to be copied. Can I use the same model to get a store from serverA.databaseA and then insert into server.databaseB?
Upvotes: 1
Views: 141
Reputation: 18797
You can have two similar DbSet
s in two different DbContext classes. As mentioned in comments, the real problem is to deal with identity columns and IMO with context attachments. I think best way is to handle identity columns manually and fetch data from db in a detached state.
Upvotes: 1