TAILIEUCHUNG - Pro Entity Framework 4.0 - Apress_7

Dịch vụ dữ liệu được thêm vào dự án của chúng tôi, liên quan đến tập tin cs. Sẽ tự động được hiển thị trong IDE. Hình 11-7 cho thấy rằng tập tin, và những gì Dịch vụ dữ liệu mẫu đã được tạo ra cho chúng ta. Kết quả về cơ bản là sự khởi đầu của dịch vụ dữ liệu của chúng tôi. | CHAPTER 11 N-TIER DEVELOPMENT WITH WCF DATA SERVICES Solution Explorer - -p X Ql ElEll WebApplicationl t Properties t Bi References t o Account Qj App_Data t Scripts t Styles âẵ a a ul t 1 1 n Figure 11 -6. The AWService WCF Service When the Data Service is added to our project the associated .cs file will automatically be displayed in the IDE. Figure 11-7 shows that file and what the Data Service template has generated for us. The result is basically the beginning of our data service. Figure 11-7. Data Service shell As you can see in Figure 11-7 the template also generates some instructions for us which provide us some direction as to what we need to do next. The first thing we need to do is wire up our data service to our data model so that the service knows where to get its data. We know where to do this because as 193 CHAPTER 11 N-TIER DEVELOPMENT WITH WCF DATA SERVICES you can see in the highlighted code in Figure 11-7 the code tells us where. Thus replace the code comment with the name of the AdventureWorksEntities see the note a few pages back regarding this value . When you have made the change the public class line of code will look like the following public class AWService DataService AdventureWorksEntities Wiring up our data service to the model is as simple as that. Believe it or not we are ready to test our service. Testing the WCF Data Service Testing our WCF Data Service provides us not only the chance to see if our little application works but also the opportunity to explore some of the WCF Data Service functionality and the interaction between EF and the WCF Data Service. You will also see why we built this project in an Web Application. Press Ctrl F5 to compile and run the project. When the project runs the web browser will open and display what you see in Figure 11-8. Figure 11 -8. Initial test results

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