禁用自动多元化的LINQ to SQL类的单一类只 [英] Disabling automatic pluralization in Linq to SQL Classes for a single class only
问题描述
我有一个不规则的多个(复数是相同的,单数)的单个表名。有没有什么办法可以禁用自动多元化(账号= DB.Accounts)对于单个表,同时保留该功能的其他人呢?
I have a single table name with an irregular plural (the plural is the same as the singular). Is there any way to disable the automatic pluralization (Account = DB.Accounts) for that single table while retaining the feature for the others?
推荐答案
您需要禁用复数表名的LINQ to SQL设计。
You need to disable the Pluralize Table Names for the LINQ to SQL designer.
要做到这一点导航到工具 - >选项 - >数据库工具 - > O / R设计和更改名称的多元化为false
To do this navigate to Tools -> Options -> Database Tools -> O/R Designer and change the Pluralization of names to false.
然后,你将需要重新编译您的项目,要针对命名
Then you will need to recompile your project and it should address the naming
<一个href="http://stackoverflow.com/questions/335792/linq-to-sql-how-do-i-stop-the-auto-generated-object-name-from-being-renamed">Linq到SQL:如何从被改名停止自动生成的对象名称
这篇关于禁用自动多元化的LINQ to SQL类的单一类只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!