从 IQueryable 到 TableQuery
From IQueryable to TableQuery
使用 Azure 存储 4.3.0 并为了使用 CloudTable.ExecuteQuerySegmentedAsync (TableQuery, TableContinuationToken)
我需要在 TableQuery 中转换我的 LinQ 谓词筛选条件,我该怎么做?
在VB.NET
Dim q = MyTable.CreateQuery(Of MyEntity).Where(Function(e) e.PartitionKey = "MyPK")
'Where do I go from here to use ExecuteQuerySegmentedAsync?
没关系,在 Microsoft.WindowsAzure.Storage.Table.Queryable
命名空间中我找到了我的答案,IQueryable.AsTableQuery:
Imports Microsoft.WindowsAzure.Storage.Table.Queryable
[...]
Dim q = MyTable.CreateQuery(Of MyEntity).Where(Function(e) e.PartitionKey = "MyPK")
Dim qQueryable = q.AsQueryable
' And then I will properly loop on this
mySegToken = Await MyTable.ExecuteQuerySegmentedAsync(qQueryable.AsTableQuery, mySegToken)
使用 Azure 存储 4.3.0 并为了使用 CloudTable.ExecuteQuerySegmentedAsync (TableQuery, TableContinuationToken)
我需要在 TableQuery 中转换我的 LinQ 谓词筛选条件,我该怎么做?
在VB.NET
Dim q = MyTable.CreateQuery(Of MyEntity).Where(Function(e) e.PartitionKey = "MyPK")
'Where do I go from here to use ExecuteQuerySegmentedAsync?
没关系,在 Microsoft.WindowsAzure.Storage.Table.Queryable
命名空间中我找到了我的答案,IQueryable.AsTableQuery:
Imports Microsoft.WindowsAzure.Storage.Table.Queryable
[...]
Dim q = MyTable.CreateQuery(Of MyEntity).Where(Function(e) e.PartitionKey = "MyPK")
Dim qQueryable = q.AsQueryable
' And then I will properly loop on this
mySegToken = Await MyTable.ExecuteQuerySegmentedAsync(qQueryable.AsTableQuery, mySegToken)