當我使用存儲表的輸入綁定而沒有錯誤「隱藏繼承的成員」TableEntity.RowKey「時,如何訪問RowKey(和PartitionKey)?當我使用存儲器表的輸入綁定時,如何訪問RowKey(和PartitionKey)?
我可以高興地訪問基於一個PartitionKey的類別,但是當我試圖擴展到獲得RowKey,通過添加新的屬性上我的課,我得到一個錯誤...... warning CS0108: 'Person.RowKey' hides inherited member 'TableEntity.RowKey'. Use the new keyword if hiding was intended.
#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Table;
public static void Run(string myQueueItem,
IQueryable<Person> tableBinding, TraceWriter log)
{
log.Info($"C# Queue trigger:triggerblocklist processed message : [{myQueueItem}]");
// int i = tableBinding.Count();
// log.Info($"{i}");
foreach (Person person in tableBinding.Where(p => p.PartitionKey == myQueueItem)
.ToList())
{
log.Info($"RowKey: [{person.RowKey}]");
log.Info($"Categories: [{person.Categories}]");
}
}
public class Person : TableEntity
{
// public string PartitionKey { get; set; }
public string RowKey { get; set; } // !!!!!!!!!!!!!!!!!
// public string Timestamp { get; set; }
public string Categories { get; set; }
}
關於爲什麼投票下降的任何反饋? ...這似乎不是一個完全愚蠢的問題,好吧,這是一個初學者的問題,但爲什麼投票呢? – SteveC