Lập trình .net 4.0 và visual studio 2010 part 66

Azure bảng lưu trữ là Azure tùy chọn lưu trữ thứ ba và cho phép bạn lưu trữ NET đối tượng (thực thể trong Azure thuật ngữ.) Và truy cập chúng một cách tương thích với WCF dịch vụ dữ liệu. Azure bảng lưu trữ cũng yêu cầu các đơn vị của bạn có ba lĩnh vực bổ sung: | CHAPTER 16 WINDOWS AZURE Table Storage Azure table storage is the third Azure storage option and allows you to store .NET objects entities in Azure terminology and access them in a manner compatible with WCF Data Services. Azure table storage also requires that your entities have three additional fields PartitionKey RowKey TimeStamp PartionKey and RowKey are combined as a composite key to uniquely identify a row so it is important the combination of the two must be unique Figure 16-20 . The PartitionKey can be used by Azure to divide data up onto different servers for load-balancing purposes while TimeStamp is used for conflict resolution. Client Table Timestamp Partitionkey Rowkey Properties 2009-03-01 14 00 00 Partitionl 1 Bill Gates Microsoft US 2009-04-02 14 00 00 Partition 2 Eric Nelson Microsoft UK 2009-05-03 14 00 00 Partition 3 Scott Guthrie Microsoft US 2009-06-04 14 00 00 Partition2 1 Larry Page Google 2009-07-05 14 00 00 Partition 2 Sergey Brin Google Figure 16-20. Visualization of an Azure table I think it s fair to say that table storage is probably not the most intuitive technology ever invented but it is very flexible and easy to use once you get over the initial What the heck is this . Items stored in table storage are created as standard .NET classes that inherit from TableServiceEntity. Another context class that inherits from TableServiceContext is also created that is used to interact with table storage. This is actually simpler than it sounds so let s create an example of table storage now to save and retrieve a Film entity. 1. Create a new Cloud Service project called adding a single web role to it. 2. In the WebRole1 project add a reference to . 3. Open the file and add the following entry to the ConfigurationSettings section Setting name DataConnectionString 4. Open and add the following entry to ConfigurationSettings Setting name .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
76    717    3    16-04-2024
Đã 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.