Cosmos: Detect partition key filters in more queries
Currently one needs to write the query like this to use a partition key:
var blogs = context.Blogs.WithPartitionKey("1337").ToList();
Instead we could automatically detect the partition key filter if used:
var blogs = context.Blogs.Where(b => b.PartitionKey == "1337").ToList();
Is it already included into EF Core 5.0 release? I am going to use querying by partition key in HasQueryFilter and would like to know whether it will be properly translated into a single partition query by specifying the detected partition key value in QueryRequestOptions.
Is it already included into EF Core 5.0 release? I am going to use querying by partition key in HasQueryFilter and would like to know whether it will be properly translated into a single partition query by specifying the detected partition key value in QueryRequestOptions.
I am also interested in this outcome.
Is it already included into EF Core 5.0 release?
This issue is still open therefore it hasn't been implemented.
Use WithPartitionKey to get the expected query.
Is it already included into EF Core 5.0 release?
This issue is still open therefore it hasn't been implemented. Use
WithPartitionKeyto get the expected query.
Are you certain? The PR was merged, as I recall.
Nevermind, it is in fact in 5.0, but in very limited fashion.
You can enable Debug logging to make sure your query is getting picked up correctly
This is not fixed. The only place where PR identified this is for case of Find or query similar to dbset.Where(keypredicate).FirstOrDefault()