Measure the test taker's knowledge about the position of linq to SQL in development.

Source: Internet
Author: User

I have studied the case of NerdDinner over the past few days. I have not only understood the asp.net mvc framework, but also learned how to use it in linq to SQL.
During the development process, we usually need to use the ORM technology to encapsulate the database so that we can well manipulate the tables in the database. In the past, we can use codesmith to write an automatic template or use a third-party code generation tool. Now we don't need it anymore. Microsoft has already provided us with the easy-to-use technology of Linq to SQL, which can persist our data. This development mode of LINQ also changes the way in which the system architecture is built. In the past, the data access layer DAL had to access data fields, the business logic layer BLL needs to process data through the data Model layer Model, while the LINQ and VS2008 provide us with a completely new automatic way to generate the data Model layer, this is dbml (Database Mark Language. The database Description Language is a document in xml format used to describe the database.) with this language, we do not need to find third-party code generation tools, drag the data table to the designer.

First, we need to create a new linq to SQL class file, the method is very simple, such

Then, we need to open the database server. Find the required database, as shown in figure

Finally, drag and drop the table to the newly created linq to SQL file.

Linq to SQL automatically generates ORM objects for us, encapsulates database objects, and has generated CRUD operations. What we need to do is to call them directly. However, we usually pay attention to the concept of layering during development. Therefore, we can use this part as the entity layer and then create a new DAL layer. Perform actual database operations. In addition, you can also use the simple query language like linq to facilitate our development. Especially when developing small and medium systems or websites, It is very convenient. It is recommended.

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.