TAILIEUCHUNG - Professional LINQ phần 7

Chắc chắn, làm việc với các chú thích, các sự kiện, và các trục có thể được khó khăn, nhưng mục đích của chương này là để cho bạn thấy rằng làm việc với họ cũng có thể thú vị và hết sức vui vẻ. Trước tiên, bạn kiểm tra xây dựng chức năng và vai trò quan trọng đóng trong LINQ to XML. Xây dựng chức năng cung cấp khả năng dễ dàng | Part III LINQ to SQL The following table lists the similarities and differences between a standard LINQ query and a LINQ to SQL query. Notice that most of the query items are identical meaning that they follow the same syntax. The only differences are the way joins are handled and the query variable return type. Query Item LINQ LINQ to SQL Query variable return type IEnumerable IQueryable Data source specification From from equivalent Filtering Where where equivalent Grouping Goupby equivalent Selecting Select select equivalent Joins join Association attribute In LINQ to SQL joins the recommended technique is to use the Association attribute but as you saw in Chapter 3 it is possible to use the join clause. However the join clause does not have access to any of the properties employed by the Association attribute thus limiting its flexibility. LINQ to SQL also employs the same rules of query execution as a standard LINQ query meaning deferred and immediate. You recall that a deferred execution query is one that produces a sequence of values and the query is not executed until you iterate through the results that is iterate over the query variable . An immediate executed query is one that returns a single value such as a query that returns a MAX value or count . These types of queries are executed immediately because a sequence must be produced first to generate the result. There are several components involved when a query is executed LINQ to SQL API LINQ to SQL Provider ADO Provider Each of these components plays a pivotal role when executing a query. When a LINQ to SQL query is executed seven steps are taken to execute the query and return the results. 1. The LINQ to SQL API requests execution of the query on behalf of your application. 2. The LINQ to SQL API hands the query off to the LINQ to SQL Provider. 3. The LINQ to SQL Provider converts the LINQ query to T-SQL. 4. The LINQ to SQL Provider hands the new query off to the ADO Provider for execution on the .

TỪ KHÓA LIÊN QUAN
Đã 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.