Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Dec 1, 2025

Fixes #37252

Description

EF 10 brought multiple improvements in how parameters are named and managed. Unfortunately, an edge case in the Cosmos provider specifically wasn't dealt with, leading to a regression.

Customer impact

Cosmos queries use the FromSql() API (raw SQL, non-LINQ querying), and also call Skip or Take (LINQ operators which accept a parameter directly, without a lambda) generate incorrect SQL that will fail, or in some edge cases, might return incorrect data.

How found

Customer reported on 10.0.0

Regression

Yes.

Testing

Added.

Risk

Low: short, targeted fix. Quirk added.

@roji roji force-pushed the CosmosParameterBugs branch from 84d57d8 to 71244b1 Compare December 1, 2025 20:03
@roji roji changed the title [release/10.0] Fix parameter naming for FromSql and regular parameters [release/10.0] Fix Cosmos parameter naming for FromSql and regular parameters Dec 1, 2025
@roji roji force-pushed the CosmosParameterBugs branch from 71244b1 to 306b55e Compare December 2, 2025 07:35
@roji roji marked this pull request as ready for review December 2, 2025 09:40
@roji roji requested a review from a team as a code owner December 2, 2025 09:40
@roji roji requested a review from artl93 December 2, 2025 10:19
Copy link
Member

@artl93 artl93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customer reported regression w/ quirk. Approved.

@artl93
Copy link
Member

artl93 commented Dec 2, 2025

@roji - FYI should this be targeting main, or release?

@roji
Copy link
Member Author

roji commented Dec 2, 2025

Good catch @artl93, thanks - will rebase.

@roji roji changed the base branch from main to release/10.0 December 3, 2025 17:34
@roji
Copy link
Member Author

roji commented Dec 3, 2025

Approved via email.

@roji roji enabled auto-merge (squash) December 3, 2025 18:06
@rbhanda rbhanda added this to the 10.0.2 milestone Dec 3, 2025
@roji roji merged commit 094ac50 into dotnet:release/10.0 Dec 3, 2025
7 checks passed
@roji roji deleted the CosmosParameterBugs branch December 3, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to use (Sql)Parameter with FromSqlRaw with Cosmos DB

5 participants