Training Kits里的第一篇实例教程,简单记录下过程,并根据理解做些旁注,方便日后查看。
1. 新建一个Cloud Service工程, 增加一个ASP.NET Web Role
2. 增加一个Class Library, 添加所需References,定义Entity Schema -- GuestBookEntry.cs
using System;
using Microsoft.WindowsAzure.StorageClient;
namespace GuestBook_Data { public class GuestBookEntry : TableServiceEntity
{ public GuestBookEntry() { PartitionKey = DateTime.UtcNow.ToString("MMddyyyy"); // Row key allows sorting, so we make sure the rows come back in time order.
RowKey = string.Format("{0:10}_{1}", DateTime.MaxValue.Ticks - DateTime.Now.Ticks, Guid.NewGuid()); } public string Message { get; set; } public string GuestName { get; set; } public string PhotoUrl { get; set; } public string ThumbnailUrl { get; set; } } }