Exemple #1
0
        static void Main(string[] args)
        {
            LinqSamples samples = new LinqSamples();

            // Comment or uncomment the method calls below to run or not
            samples.DataSetLinq28();    // This sample uses orderby to sort a list of words alphabetically.
            //samples.DataSetLinq29();    // This sample uses orderby to sort a list of words by length.
            //samples.DataSetLinq30();    // This sample uses orderby to sort a list of products by name.
            //samples.DataSetLinq31();    // This sample uses an OrderBy clause with a custom comparer to do a case-insensitive sort of the words in an array.
            //samples.DataSetLinq32();    // This sample uses orderby and descending to sort a list of doubles from highest to lowest.
            //samples.DataSetLinq33();    // This sample uses orderby to sort a list of products by units in stock from highest to lowest.
            //samples.DataSetLinq34();    // This sample uses an OrderBy clause with a custom comparer to do a case-insensitive descending sort of the words in an array.
            //samples.DataSetLinq35();    // This sample uses a compound orderby to sort a list of digits, first by length of their name, and then alphabetically by the name itself.
            //samples.DataSetLinq36();    // This sample uses an OrderBy and a ThenBy clause with a custom comparer to sort first by word length and then by a case-insensitive sort of the words in an array.
            //samples.DataSetLinq37();    // This sample uses a compound orderby to sort a list of products, first by category, and then by unit price, from highest to lowest.
            //samples.DataSetLinq38();    // This sample uses an OrderBy and a ThenBy clause with a custom comparer to sort first by word length and then by a case-insensitive descending sort of the words in an array.
            //samples.DataSetLinq39();    // This sample uses Reverse to create a list of all digits in the array whose second letter is 'i' that is reversed from the order in the original array.
            //samples.DataSetLinq40();    // This sample uses group by to partition a list of numbers by their remainder when divided by 5.
            //samples.DataSetLinq41();    // This sample uses group by to partition a list of words by their first letter.
            //samples.DataSetLinq42();    // This sample uses group by to partition a list of products by category.
            //samples.DataSetLinq43();    // This sample uses group by to partition a list of each customer's orders, first by year, and then by month.
            //samples.DataSetLinq44();    // This sample uses GroupBy to partition trimmed elements of an array using a custom comparer that matches words that are anagrams of each other.
            //samples.DataSetLinq45();    // This sample uses GroupBy to partition trimmed elements of an array using a custom comparer that matches words that are anagrams of each other, and then converts the results to uppercase.
        }