Open In App

LINQPad – Inroduction and Installation

LINQPad is a free tool that dot net developers use. It is like a dot net developer playground because it is used for various purposes. This tool can be used for,

There are many applications that have many clients and one server architecture. But LINQPad uses a different approach. It uses one client and many servers architecture. Every query in LINQPad has a separate server. It comes with some features like syntax highlighting, auto-completion, data representation, and red underlines for incorrect code. LINQPad 5 uses the Microsoft ‘Roslyn‘ library for compiling, parsing, and binding. This makes LINQPad more efficient than any other tool.



Installation in PC

LINQPadInstall

Click on next

Program in LINQPad to Find the Odd Numbers from an Array of Integers using C#

int[] numbers = {1,2,3,4,5,6,7,8,9,10};



We can also use var like this

var numbers = new int[]{1,2,3,4,5,6,7,8,9,10};

List<int> result = numbers

.Where(x => x % 2 != 0)

.OrderByDescending(x => x)

.ToList();

result.Dump();




using System;
using System.Linq;
using System.Collections.Generic;
 
public class GFG
{
    public static void Main()
    {
        int[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
 
        List<int> result = numbers
            .Where(x => x % 2 != 0)       
            .OrderByDescending(x => x)    
            .ToList();
 
        foreach (var number in result)
        {
            Console.WriteLine(number);
        }
    }
}

Output:

Output

In the output, you can observe the numbers in descending order. It also has some other tabs as well.

Conclusion


Article Tags :
SQL