EDMX中导航属性命名约定的问题 [英] Problem with Navigation Property naming convention in EDMX

查看:143
本文介绍了EDMX中导航属性命名约定的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的外键名称是

FK_Employee_Departmemt_Source
FK_Employee_Departmemt_Status

FK_Employee_Departmemt_Source FK_Employee_Departmemt_Status

但是当我添加EDMX中的员工和部门表,实体框架自动将其名称更改为

but when i add Employee and Department table in EDMX, Entity Framework automatically change their names to

部门
Department1

Department Department1

我希望它保持不变,请帮助。

I want it to be remain the same, Kindly help.

谢谢

推荐答案

您希望它保持 FK_Employee_Departmemt_Status ?您应该真正阅读有关.NET中命名约定的内容。没关系,因为我知道你不能改变这种行为,你必须在从数据库更新后手动修改名称。此外,在这种情况下,您将有一个重大变化,您将在每次更新包含该FK的实体后执行此操作。

You want it to remain FK_Employee_Departmemt_Status? You should really read something about naming conventions in .NET. Never mind as I know you cannot change this behavior and you must modify names manually after updating from database. Moreover in this case you have a big change you will have to do it after each update of the entity containing that FK.

这篇关于EDMX中导航属性命名约定的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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