How to use context.Set and context.Entry, which ships with EF4.1 ? Hello, I am trying to implement a generic repository as explained on the following link :- http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-p…
默认情况下,EF4.1是只查询到涉及到的数据对象,但是EF4.1支持两种方法进行控制其加载: 1.贪婪加载 2.延迟加载 使用的表还是上次使用的Order 和 OrderDetails两张表来举例说明 1.贪婪加载 看下面一段代码: var orders = from o in db.Orders.Include("OrderDetails") where o.CustormName == "xiaoxiao" select o; 我们可以 直接Tostring()…