如何从 SqlMetal 生成的对象中排除方案名称?
SqlMetal 正在创建对象名称,例如...
View:
Sales.ProductDescription
创建为:
Sales_ProductDescription
理想情况下,SqlMetal 会在命名空间 .Sales. 下创建 ProductDescription 类,但这可能要求过高。那么有没有办法让它创建没有 sheme 前缀(例如“ProductDescription”)的类。
谢谢,
贾斯汀
SqlMetal is creating object names such as...
The View:
Sales.ProductDescription
is created as:
Sales_ProductDescription
Ideally SqlMetal would create the ProductDescription class under a namespace .Sales. but thats probably too much to ask for. So is there anyways to get it to create the class without the sheme prefix such as "ProductDescription".
Thanks,
Justin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这将涉及在生成 DBML 文件后对其进行一些修改。但是,就可维护性而言,可能会限制您在架构更改时快速重新生成的能力。
如果您有一个不稳定的架构,您可以查看此 我不久前编写的 powershell 脚本集合,它将处理对 DBML 的此类更改。它采用 XML 文件作为输入。警告:代码存储库中的示例可能已过时,但脚本确实有效 - 我仍然使用它们。
This would involve some modifications to the DBML file after it's been generated. However, in terms of maintainability that might restrict your ability to quickly regenerate when the schema changes.
If you have a volatile schema you could check out this collection of powershell scripts I wrote some time ago that will handle such changes to the DBML. It takes an XML file as input. Warning: the sample in the code repository may be out of date, but the scripts certainly work - I still use them.
SqlMetal 有一个可选参数来包含命名空间。默认值是没有命名空间。查看 MSDN 上的此链接。
http://msdn.microsoft.com/en-us/library/bb386987.aspx
SqlMetal has an optional parameter to include a namespace. The default value is no namespace. Check out this link on MSDN.
http://msdn.microsoft.com/en-us/library/bb386987.aspx