How do I exclude the Scheme name from SqlMetal generated Objects?
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 "ProductDescri开发者_运维知识库ption".
Thanks,
JustinThis 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 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
精彩评论