Windows Azure 数据存储与 WCF 数据服务实现全解析
一、Windows Azure 数据存储操作
在 Windows Azure 中进行数据存储,有多种方式可供选择,下面将详细介绍相关操作。
(一)表存储操作示例
若要获取大量记录,可使用 TableQuery 。以下是一个测试示例,展示了创建表、添加记录、获取记录以及删除记录的完整生命周期。
public class Record : TableEntity
{
public Record() : this(DateTime.UtcNow.ToShortDateString(), Guid.NewGuid().ToString())
{ }
public Record(string partitionKey, string rowKey)
{
this.PartitionKey = partitionKey;
this.RowKey = rowKey;
}
public string FirstName { get; set; }
public string LastName { get; set; }
}
[TestCase("file")]
public void UploadTableFromConfig(string tableName)
{
// ARRANGE
CloudStorageAccount acct = CloudStorageAccount.Parse(Configur
Windows Azure 数据存储与 WCF 服务解析
超级会员免费看
订阅专栏 解锁全文
20

被折叠的 条评论
为什么被折叠?



