使用 SQLMetal 的 LINQ to SQL 中的一对一关系(基数)

发布于 2024-08-15 06:13:21 字数 82 浏览 2 评论 0原文

使用 SQLMetal 生成 dbml 时是否可以设置 OneToOne 关系(基数)?默认情况下,dbml 模式使用 OneToMany 关系生成。

Is there any possibility to set OneToOne relation (cardinality) when generate dbml with SQLMetal? By default dbml schema generated with the OneToMany relation.

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

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

发布评论

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

评论(2

森末i 2024-08-22 06:13:21

您使用 DBML 设计器吗?如果是这样,您应该能够右键单击表示关系的箭头并选择“属性”。然后可以在属性对话框中将 Cardinality 属性设置为 OneToOne。

Are you using the DBML designer? If so you should be able to right-click the arrow that represents the relationship and select Properties. The Cardinality property can then be set in the properties dialog to OneToOne.

月亮是我掰弯的 2024-08-22 06:13:21

我使用 SqlMetal 生成 Dbml 文件,然后使用 xslt 修改它的内容(使用此 xslt 基础: http://blogs.msdn.com/ploeh/archive/2008/04/10/AutomaticallyGenerateLINQToSQLModelsFromTSQL.aspx),例如。更改基数或更改枚举的类型。

I use SqlMetal to produce a Dbml file, and then i use a xslt to modify the content of it(using this xslt base: http://blogs.msdn.com/ploeh/archive/2008/04/10/AutomaticallyGeneratingLINQToSQLModelsFromTSQL.aspx), eg. changing the cardinality or changes the type for Enums.

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