.net - Entity Framework 中的对象图是什么

标签 .net entity-framework c#-4.0

我目前正在研究 Entity Framework ,特别是自跟踪实体生成器和 POCO 实体。我在阅读中多次遇到“对象图”一词,但没有定义/解释。 Entity Framework 上下文中的“对象图”是什么?

最佳答案

我认为您的根本问题与 EF 本身无关。 “对象图”是驻留在类实例内存中的数据结构。例如,如果您有:

public class Person
{
   public string Name { get; set; }
   public Person Manager { get; set; }
}

以及内存中的一堆东西:
Person monkey = new Person()
                    {
                      Name = "Me",
                      Manager = new Person()
                                    {
                                      Name = "CTO",
                                      Manager = new Person()
                                                    {
                                                      Name = "Chairman",
                                                    }
                                    }
                    };

你会有一个 Directed Graph那就是我、我的老板和他的老板。基本上,我们在谈论 Data Structures 101 .

关于.net - Entity Framework 中的对象图是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10925518/

相关文章:

c# - 获取十进制的总小数位数(包括不重要的)

c# - 斐波那契程序未完成执行

c++ - 如何使用 VS2010 为 windows x64 位编译 Leptonica 库?

c# - EF 非静态方法需要一个目标

c# - Linq:从子列表中选择第一项?

c# - Linq 是否根据实际集合类型优化执行?

c# - Entity Framework 在调用 SaveChanges 时创建新记录

c# - 为什么 SQL Server 字符串输出参数在 EF ExecuteSqlCommand 调用中返回 0?

c# - 如何访问 Task.Factory.StartNew 中的 HttpContext.Current?

c# - EF 5 过滤任何列 - 扩展方法?