Blog of Web Developer Garry Pilkington

(ASP.Net, C#, AngularJs, JavaScript, HTML5 & UWP)

just recently I have been doing quite a bit of work with LINQ and L2S in particular. Although LINQ is nothing new now and I am sure the vast majority of readers out there have had some form of introduction to LINQ. However one of the great things that I still find fascinating is a technique called projection. This is a way to shape data coming back from a query into something more akin to what you want. Here the query is creating a new type with three fields. This is especially useful if like above you are doing some form of calculation which you want to use, but is not represented anywhere in the data model.