【发布时间】:2018-02-04 05:14:23
【问题描述】:
当我将输入绑定与存储表一起使用时,如何访问 RowKey(和 PartitionKey)而不出现错误“隐藏继承的成员 'TableEntity.RowKey”?
我可以很高兴地访问基于 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; }
}
【问题讨论】:
-
对为什么投反对票有任何反馈吗? ...这似乎不是一个完全愚蠢的问题,好吧,这是一个初学者的问题,但为什么要投反对票?
标签: azure azure-storage azure-functions azure-table-storage