模型设计器和导入模型 [英] Model Designer and Importing Models

查看:104
本文介绍了模型设计器和导入模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对新的实体框架有疑问。目前,我们正在使用Visual Studio和Entity Framework的当前发行版开发应用程序。我遇到的一个问题是模型的复杂性。随着数据库的增长和变化,模型变得庞大而且无法实际可视化系统。我需要能够将模型分解为与使用它们的服务直接相关的较小模型。问题是,有一些较大的交叉实体(组织\登录)在任何地方都使用。我需要能够包含\引用另一个模型。当前的模型设计师不支持这一点。这是一个可以在下一版EF中使用的功能吗?

I have a question about the new Entity Framework.  Right now, we are developing an application using Visual Studio and the current release version of the Entity Framework.  One of the problems that I am running into is the complexity of the model.  As the database grows and changes, the model is becoming huge and useless to actually visualize the system.  I need to be able to break the model up in to smaller models that relate directly to services using them.  The problem is that there are some larger cross-cutting entities (Organizations \ Logons ) that are used everywhere.  I need to be able to include \ reference one model from another.  THe current model designer does not support that.  Is that a feature that will be available in the next version of EF?

推荐答案

不幸的是,没有 - 这个功能不在下一个设计师的版本。如果你可以投入一些时间,你可以安排一些扩展来做你想做的事情:

1。扩展可以将常见类型及其映射加载到每个模型中。 T4模板的自定义可以排除重复的代码生成,因此只能从常见类型的edmx文件生成类。自定义T4模板可以从常见类型的edmx文件中排除上下文生成。

当然不完美,但我怀疑它会起作用。

Unfortunately, no - this feature is not in the next version of the designer. If you can invest some time, you could rig up some extensions to do what you want:

1. An extension could load the common types and their mappings into each model.
2. A customization of the T4 templates could exclude duplicate code generation so that classes are only generated from the common types' edmx file.
3. A customization of the T4 templates could exclude the context generation from the common types' edmx file.

Certainly not perfect, but I suspect it would work.


这篇关于模型设计器和导入模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆