O'Reilly logo

WCF 4.0 Multi-tier Services Development with LINQ to Entities 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

Direct SQL

LINQ to Entities is a part of the ADO.NET family of technologies. It is based on services provided by the ADO.NET provider model. Therefore it is possible to mix LINQ to Entities code with existing ADO.NET applications.

In some cases you might find that the query or submit changes facility of ObjectContext is insufficient for the specialized task that you want to perform. In these cases it is possible to use ObjectContext to issue raw SQL commands directly to the database.

The ExecuteStoreQuery() method lets you execute a raw SQL query and converts the result of your query directly into objects.

The ExecuteStoreCommand() method lets you directly execute SQL commands against the database.

For example, the following code will retrieve all ...

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