TAILIEUCHUNG - Programming LINQ,

The best way to write queres using LINQ to SQL is by having a DataContext-derived class in your code that exposes all the tables, stored procedures, and user-defined functions you need as properties of a class instance. You also need entity classes that are mapped to the database objects. As you have seen in previous chapters, this mapping can be made by using attributes to decorate classes or through an external XML mapping file. However, writing this information by hand is tedious and error-prone work. You need some tools to help you accomplish this work | . . . Microsoft Foreword by Luca Bolognese LINQ Principal Program Manager Microsoft Corporation Programming Microsoft LINQ Paolo Pialorsi Marco Russo Chapter 6 Tools for LINQ to SQL The best way to write queries using LINQ to SQL is by having a DataContext-derived class in your code that exposes all the tables stored procedures and user-defined functions you need as properties of a class instance. You also need entity classes that are mapped to the database objects. As you have seen in previous chapters this mapping can be made by using attributes to decorate classes or through an external XML mapping file. However writing this information by hand is tedious and error-prone work. You need some tools to help you accomplish this work. In this chapter you will learn about what file types are involved and what tools are available to automatically generate this information. The .NET Software Development Kit SDK includes a command-line tool named SQLMetal. Microsoft Visual Studio 2008 offers an integrated graphical tool named the Object Relational Designer. We will examine both tools from a practical point of view. Important In this chapter we use the version of the Northwind database that is included in the C samples provided with Visual Studio 2008. All the samples are contained in the Microsoft Visual Studio Samples 1033 file in your program files directory if you installed Visual Studio 2008. You can also download an updated version of these samples from http csharpsamples. File Types There are three types of files involved in LINQ to SQL entities and a mapping definition Database markup language .DBML Source code C or Visual Basic External mapping file XML A common mistake is the confusion between DBML and XML mapping files. At first sight these two files are similar but they are very different in their use and generation process. DBML Database Markup Language The DBML file contains a description of the LINQ to SQL .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.