An Extensive Examination of LINQ: Extending LINQ - Adding Query Operators

As discussed in earlier installments of this article series--most notably in, An Introduction to LINQ and The Standard Query Operators--one of LINQ's primary components is its set of standard query operators. A query operator is a method that operates on a sequence of data and performs some task based on that data, are implemented as extension methods on types that implement the IEnumerable<T> interface. Some of the standard query operators that we've explored throughout the articles in this series include: Count, Average, First, Skip, Take, Where, and OrderBy, among others.

While these standard query operators provide a great detail of functionality, there may be situations where they fall short. The good news is that it's quite easy to create your own query operators. Underneath the covers, query operators are just methods that extend types that implement IEnumerable<T> and iterate over the sequence performing some task, such as computing the total number of items in the sequence, computing the average, filtering the results, or ordering them. This article examines how to extend LINQ's functionality by creating your own extension methods. Read the full article, An Extensive Examination of LINQ: Extending LINQ - Adding Query Operators.



About the Author

Scott Mitchell

Scott Mitchell is the Editor, founder, and primary contributor to 4GuysFromRolla.com. In addition to founding 4GuysFromRolla.com, Scott also created ASPFAQs.com and ASPMessageboard.com. He works as a freelance writer, trainer, and consultant and resides in California.

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Download the Information Governance Survey Benchmark Report to gain insights that can help you further establish business value in your Records and Information Management (RIM) program and across your entire organization. Discover how your peers in the industry are dealing with this evolving information lifecycle management environment and uncover key insights such as: 87% of organizations surveyed have a RIM program in place 8% measure compliance 64% cannot get employees to "let go" of information for …

  • With JRebel, developers get to see their code changes immediately, fine-tune their code with incremental changes, debug, explore and deploy their code with ease (both locally and remotely), and ultimately spend more time coding instead of waiting for the dreaded application redeploy to finish. Every time a developer tests a code change it takes minutes to build and deploy the application. JRebel keeps the app server running at all times, so testing is instantaneous and interactive.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds