2013-03-08 79 views
0

我與蔚藍的表存儲實體檢索播放並取得了良好的MS例如通用表存儲實體檢索

http://www.windowsazure.com/en-us/develop/net/how-to-guides/table-services-v17/#retrieve-range-entities

的情況下,烏爾無聊檢查鏈接

// Retrieve storage account from connection string 
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString")); 

// Create the table client 
CloudTableClient tableClient = storageAccount.CreateCloudTableClient(); 

// Get the data service context 
TableServiceContext serviceContext = tableClient.GetDataServiceContext(); 

// Specify a partition query, using "Smith" as the partition key 
CloudTableQuery<CustomerEntity> partitionQuery = 
(from e in serviceContext.CreateQuery<CustomerEntity>("people") 
where e.PartitionKey == "Smith" 
select e).AsTableServiceQuery<CustomerEntity>(); 

// Loop through the results, displaying information about the entity 
foreach (CustomerEntity entity in partitionQuery) 
{ 
Console.WriteLine("{0}, {1}\t{2}\t{3}", entity.PartitionKey, entity.RowKey, 
    entity.Email, entity.PhoneNumber); 
} 

現在這個作品perfect.but我想概括它..所以我想通過customerEntity作爲參數,人們作爲參數(簡單的字符串表名) 並使其可重用。

所以訣竅在於傳遞customerentity作爲參數 懇求幫助:)

回答