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

Built-in LINQ extension methods and method syntax

The.NET Framework defines lots of extension methods in the System.Linq namespace, including Where, Select, SelectMany, OrderBy, OrderByDescending, ThenBy, ThenByDescending, GroupBy, Join, and GroupJoin. But remember the assembly that the namespace exists in is System.Core.

We can use these extension methods just as we would use our own extension methods. For example, we can use the Where extension method to get all vegetables from the Products list, as follows:

var veges6 = products.Where(p => p.ProductName.Contains("vegetable"));

This will give us the same result as veges1 through veges5.

As a matter of fact, the definition of the built-in LINQ extension method Where is just like our extension ...

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