EF4 two models one database, possible?

社会主义新天地 提交于 2020-02-24 04:13:10

问题


I have been searching for this answer and can't seem to find anything, but with EF4 I want to create a base model and put in our 'foundation' and any new project we create if we need to add custom tables to that sites db is it possible to add a model with just those specific tables and link it to the model in our 'foundation' I can't seem to find a good resource on something like this and this seems to be like it would be a normal thing to have a reusable base model and a separate one for any one off's

Thanks for any help or pointers!


回答1:


Yes - in a way.

You would end up having two separate, distinct Object contexts - one from your "foundation" with the basic tables and classes, and another from project-specific model.

Trouble is: you cannot move entities from one context to another... so as long as those entities never have to interact in any way, then you'll be fine.



来源:https://stackoverflow.com/questions/4761201/ef4-two-models-one-database-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!