LINQ learning notes (1) What is LINQ?

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.