Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

From IQueryable to TableQuery

Using Azure Storage 4.3.0 and in order to use CloudTable.ExecuteQuerySegmentedAsync (TableQuery, TableContinuationToken) I need to transform my LinQ predicate filter condition in a TableQuery, how can I do that?

in VB.NET

Dim q = MyTable.CreateQuery(Of MyEntity).Where(Function(e) e.PartitionKey = "MyPK")
'Where do I go from here to use ExecuteQuerySegmentedAsync?
like image 263
Shockwaver Avatar asked Feb 28 '26 00:02

Shockwaver


1 Answers

Nevermind, in the Microsoft.WindowsAzure.Storage.Table.Queryable namespace I found my answer, 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)
like image 71
Shockwaver Avatar answered Mar 02 '26 15:03

Shockwaver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!