实体框架中的实体图是什么? [英] What is entity graph in Entity Framework?

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

问题描述

我一直在研究一些实体框架教程,并且碰到过实体图一词.对于这个术语及其用法,我还没有一个明确的想法.谁能提供有关此主题的信息,例如它的含义及其在实体框架中的使用?

I have been looking into some Entity framework tutorials and I have come across the word Entity Graph. I haven't got a clear idea about this term and its use. Can anyone provide info on this topic like what it is and its use in the context of entity framework?

推荐答案

实例化对象以某种关系连接在一起时,它们称为图或实体图.实体框架有一些重要的规则,关于如何图形被保留.

When instantiated objects are joined together in a relationship they are referred to as a graph, or an entity graph. The Entity Framework has some important rules about how graphs are maintained.

例如,如果您有一个User(Entity)图,该图由具有角色,功能的用户组成.

Example, if you have a User(Entity) graph that consists of a User with Roles, Features.

  • 分离用户时

  • When you detach the User

用户将与该图断开连接,并且版本关系引用(图的边)将被破坏.

The User will be disconnected from this graph and the releationship references (Graph edges) will be destroyed.

您不能从用户转到角色/功能,因为图形的边缘(关系)被破坏了.

You cannot travel from User to Roles/Features, because the graph edges (releationships) are destroyed.

我建议您购买编程实体框架DbContext"这本书(作者:EF-Queen Julia Lerman),您会发现一个很好的解释:

I recommend you buy the "Programming Entity Framework DbContext" book (author: EF-Queen Julia Lerman) and you will find there a good explanation:

http://shop.oreilly.com/product/0636920022237.do

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

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