-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToQueryDefinition() throws ArgumentNullException on LINQ query without Where clause #1438
Comments
I have the same issue I believe. Ethical hackers are concerned about "SELECT * from ".. stuff and LINQ takes care of proper formatting. For that reason (and strong typed) I prefer linq. However, I run in similar issue when trying next: `public async Task GetCompanyBycompanyNumberAsync(string companyNumber)
For an ORM I would expect something easier to query on the index key like the PartitionKeyPath which for most developers is not the id to start with. Most likely a user, email or something know and entered by humans. Help appreciated. |
I just hit this issue as well. Is there at least a way to easily check the IQueryable? I don't want to rely on try/catch for my logic on this. |
@Matthewsre did you hit this running the latest 3.18.0 SDK? |
This isssue is still there with 3.20.0.0 If I add the where clause it works, but without it, it does not: ` Company company = null;
|
If you want to Select everything without any condition. Right way to do it is: _this.container.GetItemLinqQueryable().Select(x => x) Pasting few links for your reference : |
If doing the following causes a null ref it still needs to be fixed.
|
Describe the bug
Calling
.ToQueryDefinition()
throws anArgumentNullException
with messageValue cannot be null. (Parameter 'sqlQuery')
if a Where clause hasn't been added to the LINQ query.The string representation of the IOrderedQueryable is the url path to the Container.
If I set a dummy lambda (
.Where(q => true)
) the query works.To Reproduce
Expected behavior
The query will return the Items in the Container.
Actual behavior
An
ArgumentNullException
is thrown.Environment summary
SDK Version: 3.6.0 and 3.8.0
OS Version: Windows 10, Visual Studio Professional 2019 16.5.3
Additional context
Was previously reported and closed as Resolved: #719
The text was updated successfully, but these errors were encountered: