24
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
7
public class Program
8
{
9
public static void Main()
10
{
11
// Data source
12
string[] names = { "Bill", "Steve", "James", "Mohan" };
13
// LINQ Query
14
var myLinqQuery = from name in names
15
where name.Contains('a')
16
select name;
17
18
// Query execution
19
foreach(var name in myLinqQuery)
20
{
21
Console.WriteLine(name);
22
}
23
}
24
}
Cached Result