Description: linqtosql

Source: Internet
Author: User

Description: linqtosql
1. Basics:Language Integrated Query is a set of extensions for c # and Visual Basic languages. It allows you to write C # Or Visual Basic code to query memory data in the same way as a database. It is a feature integrated in. NET programming languages. It has become an integral part of programming languages. During programming, you can get good syntax check, rich metadata, smart sensing, static type, and other advantages of strong language. In addition, it also enables queries to conveniently Query Information in the memory, not just external data sources. LINQ consists of the following parts:
Linq to Objects: Provides queries for any type of C # Memory Objects, such as arrays, lists, and other collection types.

LINQ to SQL: the. NET language Integrated Query Based on relational data. It is used to manage relational data in the form of objects and provides rich query functions. It is built on the integration of SQL-Based Schema definitions in public language systems. When maintaining the relational model expression capability and the performance of direct query and Evaluation of underlying storage, this integration provides strong types of relational data.

LINQ to XML: Perform Xml operations in the System. XML. LINQ namespace. Uses efficient, easy-to-use, in-memory XML tools to provide XPath/XQuery functions in the host programming language.

2. Usage:

The query expression must start with the from clause and end with the select or group clause. Between the first from clause and the last select or group clause, a query expression can contain one or more of the following optional clauses: where, orderby, join, let, or even additional from clause. You can also use the into keyword to make the results of join or group Clauses Act as the source for adding query clauses to the same query expression.

Here is a simple example (getting all users ):

Var allUsers = from c in Users

Select c;

3. Link:

Quick learning and using the Linq channel: http://www.cnblogs.com/knowledgesea/p/3897665.html

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.