实体模型将"s"添加到列表中.表名末尾 [英] Entity model adds "s" at the end of table names

查看:82
本文介绍了实体模型将"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设置为False.

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天全站免登陆