Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » ObjectQuery   (RSS)
Tip 28 - How to implement an Eager Loading strategy
Background: Over the last 2 years lots of people have complained about the way Eager loading works in the Entity Framework, or rather the way you ask the Entity Framework to eagerly load. Here is how you do it: var results = from b in ctx.Blogs.Include(“Posts”) Read More...
Tip 25 – How to Get Entities by key the easy way
Sometimes rather than writing this: var customer = ctx.Customers.First(c => c.ID == 5); You would rather write something like this: var customer = ctx.Customers.GetCustomerById(5); In .NET 4.0 this would be trivial to do by modifying the T4 templates Read More...
Tip 24 – How to get the ObjectContext from an Entity
Customers often ask how to get from an Entity back to the ObjectContext . Now generally we don’t recommend trying this. But sometimes you really need a way to get to the ObjectContext . For example if you are in method and all you have is the Entity, Read More...
Page view tracker