Productivity
Today we have a closer look at using LINQ and anonymous types and it's pros and cons. Consider the case where we want to obtain a subset of data instead of an entire persistent instance. For example, if we want to obtain the contact details of all Customers based in London we would use the following query var query = from c in scope.Extent<Customer>() where c.City.Equals("London") select new { c.City, c.Address, c.ContactName }; Notice the last line in the above query - select new { c.City, c.Address, c.ContactName } This line creates an anonymous type. Behind the scenes, at compile time, a very simple class is generated automatically. In this case, three...