unify two models (edmx) with visual studio 2010

2019-06-07 08:11发布

Hello as actually as i know you can not make relations between tow models or have in one models entities from two databases, it's a posibility two join two models both of them with existig databases behind? or there is some experience with a method like:

move entities from the designer of one of them to the other and some bcp (SQL server) magic to move data and recreation on only one database?

Thanks.

1条回答
ゆ 、 Hurt°
2楼-- · 2019-06-07 08:59

As I know the answer is: No you can't join models targeting different databases and you can't place entities from multiple databases in single model. However you should be able to make relations among entities from multiple models targeting the same database. More in these articles: part 1, part 2.

The partial workaround for multiple databases can be views representing tables from the second database in your first model and creating relations directly in the model (by Foreign key associations with referential constraints) but I didn't try this.

查看更多
登录 后发表回答