所以根据this issue on GitHub ,v2 Azure Functions 不再支持 IQueryable
。这也体现在 the official docs 。该文档还提到 CloudTable 可用于绑定(bind)到表存储,但没有提供具体信息或示例。
在一个最小的工作示例中,v2 Azure Functions 的表存储绑定(bind)是什么样子的(例如,从表存储中读取表的所有行)?
非常感谢任何帮助!
最佳答案
应该很简单
[FunctionName("TestFunction")]
public static async Task Run(
[QueueTrigger("test-queue")] string message,
[Table("testTable")] CloudTable testTable)
{
var querySegment = testTable.ExecuteQuerySegmentedAsync(new TableQuery<ResultEntity>(), null);
foreach (ResultEntity item in querySegment.Result)
{
// Access table storage items here
}
}
提供完整的工作示例 here .
关于azure - 使用 CloudTable 绑定(bind)到 v2 Azure Functions 中的表存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48922485/