Click here to Skip to main content
15,892,161 members
Articles / Programming Languages / C# 4.0

How does it work in C#? - Part 2

Rate me:
Please Sign up or sign in to vote.
4.81/5 (42 votes)
4 Feb 2013CPOL7 min read 104.2K   1.8K   150  
How does throw, rethrow and where, select clause of Enumerable class work in C# programming language.

namespace TestHarnessPart2
{
    using System.Collections.Generic;
    using System.Linq;
    class WhereSelect
    {
        List<string> bookList = new List<string>() { "Einstein: His Life and Universe", "Ideas And Opinions", "The World As I See It " };

        public IEnumerable<string> GetBookListWhichLengthIsGreaterThan(int lengthOfTheBookName)
        {
            //return bookList.Where(book => book.Length == lengthOfTheBookName).Select(book => book);
            return bookList.Where(book =>
            {
                var currentBook = book;
                return book.Length > lengthOfTheBookName;
            }).Select(book =>
            {
                var currentBook = book;
                return book;
            });
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Australia Australia

Comments and Discussions