Closed IdeaHunter closed 5 years ago
Hi @IdeaHunter, Thanks for reporting this. I also notice this won't work either with the legacy storage sdk as well. I'll see if this is by design or an actual bug.
Alternatively, you can still use the following for Query:
subitemQuery = new TableQuery
Thanks,
@donghexu it is look by a design, however i have found a way to do to queries, but API is very unusual
tables.GetTableReference($"{tableNamePrefix}{subtable}");
var subitems = table.CreateQuery<AuditEntity>()
.AsQueryable<AuditEntity>()
.Where(e=>e.ParentPartitionKey == Convert.ToString(itemId) && e.ParentRowKey == version)
.ToList();
First it understands Linq, second after the query had been build , ToList should be called on query and not ExecuteQuery on table. Calling ToList is the only way to apply query. Also the fact that you can set FilterString is not supported(not sure why it is possible via api). With how filter works now FilterString setter should be internal and not exposed and causing confusion
Hi @IdeaHunter , thanks very much for the information. As you mentioned, the API is unusual, so my recommendation is to use the common pattern as mentioned above. The way you pasted seems only work for Quaryable case that understanding Linq, I'll explore it in a later manner. I will evaluate the FilterString access level. But since it is public since the beginning, I doubt we should now make the setter internal. I'll see what I dig out.
Closing this thread. Original issue is due to a mix up of Linq based query API with OData based query APIs.
I have tried to use filtering on PartitionKey and it not working
subitemQuery loads 2 items whenever it should load single item also i used fiddler to check what kind of request it made and i expected something like ?$filter=PartitionKey eq '1' in a request url but it simply isnt there
Library version: 1.0.1