实体模型添加“s"在表名的末尾 [英] Entity model adds "s" at the end of table names

查看:17
本文介绍了实体模型添加“s"在表名的末尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的 ASP.NET 应用程序中创建实体模型时,它会在每个实体名称的末尾添加s",即如果我的表名在数据库中是SiteUser",它在实体模型中变为SiteUsers".我该如何预防?

When I create Entity Model in my ASP.NET application it adds "s" at the end of each entity name, i.e. if my table name is "SiteUser" in database it becomes "SiteUsers" in Entity Model. How can I prevent it?

推荐答案

打开您的 EDMX 文件,单击设计器视图中的空白区域,然后在属性窗口中将 Pluralize New Objects 设置为 错误.

Open your EDMX file, click on an empty space in your designer view and in the properties window set Pluralize New Objects to False.

这篇关于实体模型添加“s"在表名的末尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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