arame3333
arame3333

Reputation: 10193

Entity Framework - how to manage tables in different databases but on the same server?

I am using SQL Server 2008.

It seems as though in EF I need a different entity context for each database. Joining tables between databases means having to allow for this which is inconvenient and makes it more likely that I would simply put everything in one database.

Am I missing something? Surely EF can work better than this?

Upvotes: 3

Views: 2740

Answers (2)

Joe Ratzer
Joe Ratzer

Reputation: 18549

I don't think it's properly supported, but this guy has managed to get it to work.

Basically, she set up Synonyms for the databases, and hacked the edmx file.

Upvotes: 3

ken2k
ken2k

Reputation: 48985

You could map your entities to a view that returns joined tables, so your EF model doesn't know about all this technical DB stuff.

Upvotes: 6

Related Questions