用于 LINQ-to-SQL 和实体框架代码生成器的编程 API

发布于 2024-11-17 09:43:33 字数 149 浏览 5 评论 0原文

有哪些选项可以为 LINQ-to-SQL实体框架 上下文和数据实体对象生成类定义?我了解如何使用 Visual Studio 工具,但是是否有一个编程 API 可以用来定义模型并从另一个应用程序生成相应的代码?

What options do I have for generating class definitions for LINQ-to-SQL and Entity Framework context and data entity objects? I understand how to use the Visual Studio tools, but is there a programmatic API I can use to define the model and generate the corresponding code from another application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别把无礼当个性 2024-11-24 09:43:33

Linq to SQL 选项并不是很好——我所知道的最好的事情是 L2ST4 它至少提供了更多功能控制生成的类。设计器文档是一个大而精美的 XML 文件,所以我想如果您有动力的话,您可以制作一些在外部生成它的东西。

实体框架有更好的选择——特别是因为 v 4.1 为您提供了代码优先。因此,这意味着您需要做的就是生成一个 C# 类,然后 EF 处理其余的事情。

Linq to SQL options aren't great -- best thing I know of is L2ST4 which at least gives one much more control over the generated classes. The designer document is a big, fancy XML file so I guess you could make something that generates it externally if you were so motivated.

Entity Framework has much better options -- especially since v 4.1 gives you code-first. So that means all you need to do is generate a C# class and then EF handles the rest.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文