gpt4 book ai didi

LinqPad 在每个表的末尾添加一个 S

转载 作者:行者123 更新时间:2023-12-04 05:33:38 25 4
gpt4 key购买 nike

我刚刚下载了 LinqPad 来探索在我正在开发的应用程序中使用 Linq 查询的好处,但是当我查看左侧列中的数据库表时,LinqPad 会显示我所有的表,最后带有一个“s”,例如实例 CategoryTbl 变为 CategoryTbls 但当我在 SQL management studio 中查看我的数据库时,表名显示正确。

尽管任何应该在最后有 S 的表,即客户端保持不变。

当我执行 Linq 查询时,我必须针对 CategoryTbl 执行它,但必须针对 CategoryTbl 执行 SQL 查询。

我只是想知道为什么会发生这种情况,这是错误还是功能?如果它是一个功能,为什么?

谢谢

最佳答案

第一个问题来自LINQPad FAQ :

Why does LINQPad pluralize table and child association properties? Can I switch this off?

Pluralizing child association properties (while keeping parent associations singular) makes for the most natural queries and is what Visual Studio does by default in building typed DataContexts.

To switch off pluralization, uncheck the "Pluralize" option when adding the database connection. (If the connection has already been created, right-click it to edit the connection properties).

关于LinqPad 在每个表的末尾添加一个 S,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7833133/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com