在.Net应用程序运行时生成DDL
我正在计划一个 .Net 应用程序,其中一部分涉及协助用户对实体建模并最终将其表示在物理数据库(SQL Server)中。
基本上,我希望能够从从最终用户捕获的模型生成高质量的 DDL。我研究了实体框架的可能性,但是,在这种情况下似乎需要访问 Visual Studio。
还有其他几种 .Net 代码生成工具和工具。库,但所有这些都对设计时间施加了使用限制。我希望在运行时具有这种能力。
如果我对上述问题有答案,我想进一步具备创建 .Net 实体以在运行时再次访问新创建的数据模式的能力:)
有什么想法吗?
编辑:我正在研究实体框架的仅代码开发选项。从表面上看,它看起来不错,因为它不涉及像 T4 这样的技术,这些技术只能在设计过程中使用,而且在 Visual Studio 中也可用。
尽管这种方法也涉及代码生成,但它看起来很容易管理。一个小问题是,此选项位于 CTP 中,并非其他 2 种方法(数据库到模型,反之亦然)可用的所有功能都完全可用。
请评论。
I am planning a .Net application, a part of which involves assisting a user to model an entity and finally have it represented in a physical database (SQL Server).
Basically I want to be able to generate good quality DDL from the model that I capture from the end user. I looked at possibilities with Entity Framework, however, it looks like access to Visual Studio is required in that case.
There are several other .Net code generation tools & libraries, but all of then impose the usage restriction to design time. I want this ability at runtime.
If I have answer to the above, I'd like to further have the capability of creating .Net entities to access the newly created data schema ... again at runtime :)
Any ideas?
Edit: I was looking at the Code-Only Development option with Entity Framework. Prima Facie, it looks good as it does not involve technologies like T4 that are available only during design and that too in presence of Visual Studio.
Although this approach too will involve code generation, it looks manageable. A minor catch is that this option is in CTP and not all features available with other 2 approaches (database to model and vice-versa) are completely available.
Please comment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论