top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Give an Example of Chaining LINQ Query Operators in C#?

0 votes
306 views
Give an Example of Chaining LINQ Query Operators in C#?
posted May 11, 2016 by Jayshree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
using System;

using System.Collections.Generic;

using System.Data;

using System.Linq;

namespace AbundantCode

{

internal class Program

{

//Collection Initialization Example in C#

private static void Main(string[] args)

{

List<string> ABundantCodeVersions = new List<string> { "Abundantcodev1", "Abundantcodev2", "Abundantcode3" };

var query = ABundantCodeVersions.Where(a => a.Contains("v"))

.OrderByDescending(a => a.Length)

.Select(a => a.ToLower());

foreach (string versions in query)

{

Console.WriteLine(versions);

}

Console.ReadLine();

}

}

}
answer May 11, 2016 by Shivaranjini
...