如何强制 sqlmetal 保持字段名称大小写?
当 Visual Studio 自动生成 dbml 文件时,我得到了表中出现的确切字段名称。
但是,由于VS不提供dbml的刷新功能,因此我手动运行sqlmetal来重新创建dbml文件。它工作得很好,但有一个例外——sqlmetal“更正”名称
ses_Id -> Ses_Id
aga_Id -> Aga_Id
等等——它可能会将camelCase更改为CamelCase。
Sqlmetal 帮助没有列出任何保持字段名称不变的开关(只有复数开关)。那么,有谁知道保持字段名称大小写的隐藏开关吗?
先感谢您。
已解决
没有这样的开关,并且 MS 收到了有关该问题的通知 - 添加此类功能的愿望报告(因为它会导致更新项目出现问题)已被关闭,因为不会修复:-(
When dbml file is generated automatically by Visual Studio I get the exact field names as they appeared in the tables.
However, since VS does not provide refresh function for dbml, I run sqlmetal manually to re-create dbml file. It works fine with one exception -- sqlmetal "corrects" the names
ses_Id -> Ses_Id
aga_Id -> Aga_Id
and so on -- it probably changes camelCase to CamelCase.
Sqlmetal help does not list any switch to keep field names as-is (there is only pluralize switch). So, does anyone know the hidden switch to keep the case of field name?
Thank you in advance.
SOLVED
There is no such switch, and MS was notified about the problem -- the wish report to add such feature (because it casuses problem with updating project) was closed as wontfix :-(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑是不是有隐藏开关。我遇到了同样的问题,所以我编写了一个简单的 Perl 脚本来解决它:
只需将所有内容保存到 fdbml.pl,确保安装了 ActiveState Perl,然后在 DBML 文件上运行它:
Ben
I doubt there is a hidden switch. I had the same problem, so I wrote a simple Perl script to sort it out:
Just save all that to fdbml.pl, make sure you have ActiveState Perl installed, then run this on your DBML file:
Ben