Some Linq Tips

Since its introduction alongside Visual Studio 2008, Linq has made many common programming efforts a breeze. As it has developed, Linq has become a powerful tool for interacting with SQL, Xml, and many other datasources. Developers that are familiar with the structures commonly found in a query language will feel at home using Linq in their code, and those who are less query-savvy will learn to appreciate the features that are introduced with Linq.
 
The purpose of this article, however, is to talk about Linq beyond the 101-level course. Linq is incredibly convenient and also introduces a few other programming concepts that can be applied elsewhere. This article will talk about some less well known extensions as well as the programming mechanisms used to take advantage of them. Here are a few of the things I’d like to cover:
 

  • Count, Any, and All
  • SelectMany
  • Single/SingleOrDefault
  • Zip
Advertisements
Some Linq Tips