实体框架 - 具有相同类型的模型的命名 [英] entity framework - naming of model with same types

查看:70
本文介绍了实体框架 - 具有相同类型的模型的命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2张桌子:自行车和车轮。自行车有2个FKs轮子:Bike.FrontWheelID和Bike.BackWheelID。
EF将它们映射到Bike.Wheel和Bike.Wheel1上,只需使用他们的类型名称,我宁愿避免使用。



有没有办法改变这种可以从db模式进一步重新生成模型吗? (某些设置可能吗?)



谢谢

解决方案

您可以重命名实体模型设计器中的这些属性,它不会影响模型的进一步再生。


I have 2 tables: Bikes and Wheels. Bike has 2 FKs to Wheels: Bike.FrontWheelID and Bike.BackWheelID. EF maps these onto Bike.Wheel and Bike.Wheel1, just using their type for name, which I would prefer to avoid.

Is there a way to change this that would survive further regenerations of model from db schema? (some setting perhaps?)

Thanks

解决方案

You can rename those properties in Entity Model Designer and it will not affect further regenerations of the model.

这篇关于实体框架 - 具有相同类型的模型的命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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