O'Reilly logo

WCF 4.5 Multi-Layer Services Development with Entity Framework by Mike Liu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comparing LINQ to Entities with LINQ to Objects

In the previous chapter, we used LINQ to query in-memory objects. Before we dive further into the world of LINQ to Entities, we first need to look at the relationships between LINQ to Entities and LINQ to Objects.

Some key differences between LINQ to Entities and LINQ to Objects are as follows:

  • LINQ to Entities needs an Object Context/Db Context object. The ObjectContext/DbContext object is the bridge between LINQ and the database (we will learn more about ObjectContext/DbContext later). LINQ to Objects doesn't need any intermediate LINQ provider or API.
  • LINQ to Entities returns data of type IQueryable<T>, whereas LINQ to Objects returns data of type IEnumerable<T>.
  • LINQ to Entities queries are translated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required