【发布时间】:2013-02-13 02:35:19
【问题描述】:
当使用TableServiceContext 查询 Azure 表存储时,我会执行如下查询:
var entities = context.CreateQuery<TEntity>(TableName)
.AsTableServiceQuery()
.Where(condition);
但这不能在新的客户端存储库 2.0 中编译:
方法 'AsTableServiceQuery' 没有重载需要 0 个参数。
唯一可用的方法是AsTableServiceQuery(TableServiceContext context);
这意味着我需要具备以下条件:
var entities = context.CreateQuery<TEntity>(TableName)
.AsTableServiceQuery(context)
.Where(condition);
我提供了两次上下文。为什么?
【问题讨论】:
标签: c# .net azure azure-storage azure-table-storage