Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the basics of LINQ query

Shulou Source: shulou.com Published: 2022-06-02 08:58:28 09月12日 Update

This article mainly explains "what are the basics of LINQ query". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn what are the basics of LINQ query!

Basic knowledge of LINQ query

1. The pronunciation of LINQ: (1) lin k (2) lin Q

2. Key words of LINQ: from, select, in, where, group by, order by...

3. Note to LINQ: it must end with select or group by.

4. Semantics of LINQ:

◆ from temporary variable in collection object or database object

◆ where conditional expression [order by condition]

Queried value in ◆ select temporary variable [group by condition]

The type of value returned by a LINQ query is the type of temporary variable, which may be an object or a collection. And the LINQ query expression was compiled the last time the object was created. LINQ queries are usually used in conjunction with the var keyword (what is var? Anonymous object). The following two query expressions have the same effect:

Var Q = from name in methods where (name.Name.Length > 15) select name; IEnumerable p = from name in methods where (name.Name.Length > 15) select name

So we can nest LINQ query expressions in this way:

Var Q = from t in (from name in methods where (! name.IsVirtual) select name) where (t.Name.Length > 15) select t.Name

5. The full name of LINQ: Language-Integrated Query

6. Classification of LINQ: LINQ to Object, LINQ to XML, LINQ to SQL, LINQ to ADO.NET

At this point, I believe you have a deeper understanding of "what are the basics of LINQ query?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Query object basic basic knowledge knowledge expression variable condition key content type learning practical deeper two full name keyword keyword interest practicality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn Microsoft Shulou Technology OPPO Reno