开发者

WPF Composite - Expose EF model to all modules

I have an application that uses WPF Composite, and I have an issue. I've got a big database that is attached 开发者_开发百科to the application and I need it exposed to different modules as part of the application.

What is the best way to expose my Entity Framework model to all my different modules and views inside them? Do I have one EF model or a separate one for each module and then only the tables that each module needs. The only problem being that some tables have a relationship and will have different views and those views will be in different modules.

Any ideas how to resolve this?


It sounds as though defining your Entity Framework model in another assembly that could be referenced by all your modules is likely the correct way to go. Think of this assembly as an old-school Data Access Layer, shared amongst multiple business and presentation layers. The fact that the presentation layers are all knitted together by Prism is pretty much immaterial.

You could certainly define multiple models, but I suspect that would be more maintenance than is necessary, assuming your different modules are hitting overlapping parts of the database. Given your statement about the views and relationships, I suspect having one big model is the least unwieldy solution for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜