简体   繁体   English

Visual Studio,Linq-to-Sql,设计器设置?

[英]Visual Studio, Linq-to-Sql, designer settings?

Is there some place I can change output settings for the Visual Studio Linq-to-Sql designer? 在哪里可以更改Visual Studio Linq-to-Sql设计器的输出设置? I would like to control if table names are pluralized/depluralized, add specific attributes, namespace etc. Can something of this be done without manually changing the files after they are created? 我想控制表名是否是复数/非复数的,添加特定的属性,名称空间等。创建文件后可以手动更改文件吗?

You can change the names of tables/entities from the Table properties in the designer. 您可以从设计器的“表”属性中更改表/实体的名称。 It has a Name, and a Source. 它有一个名称和一个来源。 The Source, of course, is the underlying database, but you can change the name to suit your needs. 源当然是基础数据库,但是您可以更改名称以适合您的需求。 Other than that, I don't know of a way to specifically pluralize or depluralize items. 除此之外,我不知道一种专门用于使项目多元化或多元化的方法。

Also, don't manually edit the files output by the L2S designer - they'll just get overwritten the next time you make a change in the designer. 另外,请勿手动编辑L2S设计器输出的文件-下次您对设计器进行更改时,它们将被覆盖。 To extend the generated classes, use partial classes. 要扩展生成的类,请使用部分类。

在这一点上,答案似乎是“否”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM