实体框架数据库第一 - 关系 [英] Entity Framework Database First - Relationships

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

问题描述

我想我有CodeFirst了解。现在我知道数据库第一个EF设计是针对现有的数据库,但是如果我要快速进入管理工作室中创建一个新的数据库并创建一些表格,那么您是否会在管理工作室或edmx设计师,我尝试过edmx,但是当我去调试时收到错误。这里最好的做法是什么,如果我要在设计师中做这些工作,并且管理工作室中的数据库如何知道更新,那么在表之间创建关联的正确步骤是什么?任何提示/建议不胜感激。



解决方案

在实体更新的时候,尝试使用运行自定义工具避免错误。只需右键单击您的模型和运行自定义工具


I think I have CodeFirst understood. Now I know database first EF design is targeted for existing databases, but if I were to quickly go in and create a new database in management studio and create some tables, is it normal that you would create relationships for the tables in management studio or in the edmx designer, I tried in the edmx but got errors when I went to debug. What is the best practice here and what are the correct steps to create Associations between tables if I were to do it in the designer and how does the database in management studio know to update? Any tips/advice is appreciated.

解决方案

In times that the entity is updated, try to Run Custom Tool your model to avoid errors. just Right Click your model and Run Custom Tool.

这篇关于实体框架数据库第一 - 关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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