Closed azzimuth closed 2 years ago
@azzimuth can you add the exception.ToString() to the description?
@j82w, done
It seems to be incorrectly handling the scenario if a function is passed in for a binary comparison that is not from the passed in delegate search.MarketCode.ToUpper()
.
queryable = queryable.Where(lead => lead.LeadRequest.CountryCode.ToUpper() == search.MarketCode.ToUpper());
As a temporary workaround until a fix is deployed you can do the following.
string searchMarkCode = search.MarketCode.ToUpper();
queryable = queryable.Where(lead => lead.LeadRequest.CountryCode.ToUpper() == searchMarkCode);
Great, it works. Thanks!
I would always recommend passing the partition key in the request options when possible. It guarantees that the query is restricted to a single partition. Without the partition key it's possible it will do a cross partition query which will be significantly slower and cost more RUs.
@j82w, yes, we will consider changing the partition key to the other field.
Describe the bug When I try to get items from the database using the GetItemLinqQueryable method without partition key in LINQ filters, I get
NullReferenceException
atawait cosmosQuery.CountAsync();
. As soon as I add the partition key to LINQ filters, everything works.To Reproduce Sample code here.
Expected behavior Using GetItemLinqQueryable without LINQ filter for partition key does not throw an exception. The queryable returns the items matching the filters.
Actual behavior Using GetItemLinqQueryable without LINQ filter for partition key throws an exception.
Exception details:
Environment summary SDK Version: 3.18.0 OS Version (e.g. Windows, Linux, MacOSX): Edition Windows 10 Pro Version 20H2 OS build 19042.985 Experience Windows Feature Experience Pack 120.2212.2020.0