-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathLinq_expression.cs
More file actions
29 lines (26 loc) · 902 Bytes
/
Linq_expression.cs
File metadata and controls
29 lines (26 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* LINQ(Language Integrated Query) is uniform query syntax in C# and VB.NET to retrieve data from different sources and formats.
* With LINQ, a query is a first-class language construct, just like classes, methods, events.
* It is simple, well-ordered and high-level language syntax to retrieve data from different sources and formats.
*/
using System;
using System.Collections.Generic;
using System.Linq;
namespace Basics
{
class Linq_expression
{
public void Linq()
{
int[] scores = new int[] { 97, 92, 81, 60 };
// LINQ Query Syntax
IEnumerable<int> scoreQuery = from score in scores
where score > 80
select score;
foreach (int i in scoreQuery)
{
Console.Write(i + " ");
}
}
}
}