实体框架ObjectSet名称 [英] Entity Framework ObjectSet names

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

问题描述

嗨伙计们,

我是Entity Framework的新手。我有一个小应用程序连接到MySQl数据库有六个表(其中一些是东西,东西,东西组,...)。

我创建了EF模型,但当我想在我的代码中使用它时,我意识到所有生成的ObjectSet类都附加了一个1,例如Things1,ThingsPlaces1,ThingPlaces1等等。我绝对想要删除它们。

任何帮助都是高度相关的。

谢谢。

Hi folks,
I''m new to Entity Framework. I have small application which connects to a MySQl database with six tables (some of them are "thing", "thingplace", "thinggroup", ...).
I''ve created the EF model but when I wanted to use it inside of my code I realized all generated ObjectSet classes has a "1" attached to them for example "Things1", "ThingsPlaces1", "ThingPlaces1" and so on. I definitely want to remove them.
Any help is highly appreiated.
Thanks.

推荐答案

你可以在edmx设计师那里做到这一点。单击您的实体,右键单击,选择属性(您可以选择实体后alt +输入)。然后,您将在实体集名称下找到该名称。只需将他们的名字改为你喜欢的名字,它就会在以下更新中保持这种状态。
You can do that on the edmx designer. Click on your entity, right-click, select properties (you can alt+enter after selected the entity aswell). Then, you''ll find that name under "Entity Set Name". Just change their names to whatever you like and it''ll keep that way on the following updates.


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

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