user576510
user576510

Reputation: 5915

Save and Update in two databases?

In a project EF6 is used. Now on a later stage there is requirement to use tables from an another database.

DAL is implemented using Generic Repository and Unit of Work

I'm wondering is there a way in DbContext to refer two separate databases? Also how EF will know which entity belongs to which database.

Upvotes: 3

Views: 62

Answers (1)

abatishchev
abatishchev

Reputation: 100308

I believe it's not possible to use EF in such way.

Instead create a view referencing a table in another database and map that view.

Upvotes: 1

Related Questions