Due to the relationship between work transfer, I haven't been writing a blog for a long time. Recently, my new job has been stable, so I have time to share my recent learning experience with you, really happy, haha!
Today we will share with you the knowledge of LINQ and hope you can support it. Before learning about LINQ, we need to know what LINQ is? To learn how to use it, let's introduce what it is like.
1. What is LINQ?
The language-Integrated Query (Language-integrated query) is a new feature that is integrated into C # and Visual Basic. Net to provide data query capabilities.
Note: LINQ (pronounced link)
2. What are the important advanced features of LINQ?
1> LINQ is an extension of the. NET Framework. It allows us to query data sets in the form of database queries.
2> C #3.0 includes some extensions that integrate with LINQ into the language, allowing us,ProgramQuery data in object sets and XML documents.
3. What is the architecture of LINQ?
I would like to understand the architecture of LINQ. This helps us to have a general understanding of the LINQ framework. The architecture of LINQ is shown in:
4. A simple LINQ example?
1 ClassProgram
2{
3Static VoidMain (String[] ARGs)
4{
5Int[] Numbers = {2,12,5,15};//Create an int array object as the data source. Equivalent to: int [] numbers = new int [] {2, 12, 5, 15 };
6
7Ienumerable <Int> Lownums =FromNInNumbers//Define and store the query.
8WhereN <10
9SelectN;
10
11Foreach(VaRXInLownums)//Use the foreach statement to traverse the set.
12{
13Console. Write ("{0 },", X );
14}
15
16Console. readkey ();
17}
18}
Program output result: 2, 5,
The above is what we will introduce today. Today we mainly want to know what it is called LINQ? What is the purpose of LINQ? I will introduce the anonymous type tomorrow. Thank you for your attention!