Linq to SQL:如何阻止自动生成的对象名称被重命名? [英] Linq to SQL: How do I stop the auto generated object name from being renamed?

查看:38
本文介绍了Linq to SQL:如何阻止自动生成的对象名称被重命名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2008中,当我将数据库表拖到dbml屏幕中时,任何以字母s结尾的表都会自动将s从dbml对象中删除.有什么方法可以禁用此功能吗?

In visual studio 2008, when I drag a database table into my dbml screen, any tables that end with the letter s automatcially get the s removed from the dbml object. Is there any way to disable this?

此外,行集合也将s附加到集合属性名称之后.有没有办法改变这种状况?

Also, the collection of rows also gets an s appended to the collection property name. Is there a way to change that as well?

谢谢

推荐答案

您需要为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

这篇关于Linq to SQL:如何阻止自动生成的对象名称被重命名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆