Skip to content

[release/8.0-staging] Transform Span-based overloads to Enumerable in funcletizer#35720

Merged
roji merged 1 commit intodotnet:release/8.0-stagingfrom
roji:SpanOverloads8
Mar 4, 2025
Merged

[release/8.0-staging] Transform Span-based overloads to Enumerable in funcletizer#35720
roji merged 1 commit intodotnet:release/8.0-stagingfrom
roji:SpanOverloads8

Conversation

@roji
Copy link
Member

@roji roji commented Mar 3, 2025

Backports part of #35339
Fixes #35100

Description

C# 14 (currently in preview) is introducing first-class spans, which changes the Roslyn overload resolution to prefer Span-based overloads in some cases. Unfortunately, the newly selected overloads, which have Span parameters, are unsupported in EF since the LINQ expression tree interpreter is used internally, and it does not support ref structs.

This problem already been fixed for EF 10 in #35339. However, users on older of EF Core who switch to .NET 10/C# 14 will still hit this issue. This PR proposes backporting the fix to EF Core 8.0 to ensure these users aren't affected.

Customer impact

Some very basic query patterns will start failing when trying to use EF Core 8.0 with C# 14, e.g.:

var data = new[] { "Foo", "Bar" };
_ = await context.Blogs.Where(b => data.Contains(b.Name)).ToListAsync();

How found

Reported by users on 10.

Regression

Yes, in the combination of EF Core 8.0 and C# 14.

Testing

Older versions of EF aren't tested with later versions of C#/NET; manual testing was performed.

Risk

Very low - very targeted expression tree transformation; added quirk.

@roji roji requested a review from a team March 3, 2025 22:36
@roji roji force-pushed the SpanOverloads8 branch from fd5ccaf to aec3890 Compare March 3, 2025 22:39
@roji roji merged commit eeab918 into dotnet:release/8.0-staging Mar 4, 2025
7 checks passed
@roji roji deleted the SpanOverloads8 branch March 4, 2025 08:34
This was referenced Jul 22, 2025
This was referenced Mar 16, 2026
sloweyyy added a commit to sloweyyy/cloud-native-ecommerce-platform that referenced this pull request Mar 22, 2026
….22 (#118)

Updated
[Microsoft.EntityFrameworkCore.SqlServer](https://github.com/dotnet/efcore)
from 8.0.7 to 8.0.22.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.EntityFrameworkCore.SqlServer's
releases](https://github.com/dotnet/efcore/releases)._

## 8.0.22

[Release](https://github.com/dotnet/core/releases/tag/v8.0.22)

## What's Changed
* [release/8.0-staging] Merge release/8.0 to release/8.0-staging by
@​cincuranet in dotnet/efcore#36798
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro[bot] in dotnet/efcore#36915
* Update branding to 8.0.22 by @​vseanreesermsft in
dotnet/efcore#36924
* [release/8.0] Merge release/8.0-staging to release/8.0 by @​cincuranet
in dotnet/efcore#36943
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#36968
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro[bot] in dotnet/efcore#36980


**Full Changelog**:
dotnet/efcore@v8.0.21...v8.0.22

## 8.0.21

[Release](https://github.com/dotnet/core/releases/tag/v8.0.21)

## What's Changed
* [release/8.0-staging] Merge release/8.0 to release/8.0-staging by
@​cincuranet in dotnet/efcore#36540
* Update branding to 8.0.21 by @​vseanreesermsft in
dotnet/efcore#36696
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#36727
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro[bot] in dotnet/efcore#36765
* [release/8.0] Disable Guardian Dotnet Analyzers by @​AndriySvyryd in
dotnet/efcore#36776
* [8.0] Resolve query logger from QueryContext in shaper generation
(#​36758) by @​roji in dotnet/efcore#36779
* [release/8.0] Merge release/8.0-staging to release/8.0 by @​cincuranet
in dotnet/efcore#36788
* [release/8.0] Remove OSX.13.ARM64 from HelixTargetQueues by
@​AndriySvyryd in dotnet/efcore#36838
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro[bot] in dotnet/efcore#36853
* [release/8.0] Remove OSX.13.Amd64 target from HelixTargetQueues by
@​AndriySvyryd in dotnet/efcore#36855


**Full Changelog**:
dotnet/efcore@v8.0.20...v8.0.21

## 8.0.20

[Release](https://github.com/dotnet/core/releases/tag/v8.0.20)

## What's Changed
* [release/8.0] Merge release/8.0 => release/8.0-staging by @​cincuranet
in dotnet/efcore#36197
* Update branding to 8.0.20 by @​vseanreesermsft in
dotnet/efcore#36497
* [release/8.0] Dispose related readers in
GroupBySplitQueryingEnumerable (#​36484) by @​roji in
dotnet/efcore#36489
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#36512
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro[bot] in dotnet/efcore#36533
* [release/8.0] Merge release/8.0-staging to release/8.0 by @​cincuranet
in dotnet/efcore#36531


**Full Changelog**:
dotnet/efcore@v8.0.19...v8.0.20

## 8.0.17

## Dependency Updates

- **Update dependencies from dotnet/arcade**
([#​36085](dotnet/efcore#36085))
Updates the project's dependencies using the latest versions from the
dotnet/arcade repository. This ensures that the build infrastructure and
related tooling are up to date, which can bring in important bug fixes,
security patches, and improvements from upstream.

## Miscellaneous

- **Update branding to 8.0.17**
([#​36043](dotnet/efcore#36043))
Updates the internal version branding to 8.0.17. This change ensures
that the product and its packages correctly reflect the new release
version, helping users and developers identify the build.

- **Merging internal commits for release/8.0**
([#​36080](dotnet/efcore#36080))
Integrates various internal commits into the release/8.0 branch. This
merge brings together important updates and ensures the release branch
is synchronized with recent internal development, maintaining
consistency and stability for the release.

---

This summary is generated and may contain inaccuracies. For complete
details, please review the linked pull requests.

Full Changelog:
[v8.0.16...v8.0.17](dotnet/efcore@v8.0.16...v8.0.17)

## 8.0.16

[Release](https://github.com/dotnet/core/releases/tag/v8.0.16)

## What's Changed
* Update branding to 8.0.16 by @​vseanreesermsft in
dotnet/efcore#35888
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#35926
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro in dotnet/efcore#35930


**Full Changelog**:
dotnet/efcore@v8.0.15...v8.0.16

## 8.0.15

[Release](https://github.com/dotnet/core/releases/tag/v9.0.3)

## What's Changed
* Merge branch 'release/8.0' into 'release/8.0-staging' by
@​AndriySvyryd in dotnet/efcore#35541
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro in dotnet/efcore#35633
* [release/8.0-staging] Improve LoadExtension to work correctly with
dotnet run and lib* named libs by @​roji in
dotnet/efcore#35718
* [release/8.0-staging] Transform Span-based overloads to Enumerable in
funcletizer by @​roji in dotnet/efcore#35720
* Update branding to 8.0.15 by @​vseanreesermsft in
dotnet/efcore#35738
* Merge branch 'release/8.0-staging' => 'release/8.0' by @​AndriySvyryd
in dotnet/efcore#35742
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#35765
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro in dotnet/efcore#35780


**Full Changelog**:
dotnet/efcore@v8.0.14...v8.0.15

## 8.0.14

[Release](https://github.com/dotnet/core/releases/tag/v8.0.14)

## What's Changed
* Update branding to 8.0.14 by @​vseanreesermsft in
dotnet/efcore#35583
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#35621


**Full Changelog**:
dotnet/efcore@v8.0.13...v8.0.14

## 8.0.13

[Release](https://github.com/dotnet/core/releases/tag/v8.0.13

## What's Changed
* [release/8.0] Update Helix queues by @​AndriySvyryd in
dotnet/efcore#35408
* Update branding to 8.0.13 by @​vseanreesermsft in
dotnet/efcore#35427
* Merge branch 'release/8.0-staging' => 'release/8.0' by @​AndriySvyryd
in dotnet/efcore#35464
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#35473
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro in dotnet/efcore#35470


**Full Changelog**:
dotnet/efcore@v8.0.12...v8.0.13

## 8.0.12

[Release](https://github.com/dotnet/core/releases/tag/v8.0.12)

## What's Changed
* [release/8.0-staging] Update macOS images to 13 by @​AndriySvyryd in
dotnet/efcore#35005
* Update branding to 8.0.12 by @​vseanreesermsft in
dotnet/efcore#35048
* Merge branch 'release/8.0' into release/8.0-staging by @​AndriySvyryd
in dotnet/efcore#35055
* Merge branch 'release/8.0-staging' => 'release/8.0' by @​AndriySvyryd
in dotnet/efcore#35077
* Merging internal commits for release/8.0 by @​vseanreesermsft in
dotnet/efcore#35081


**Full Changelog**:
dotnet/efcore@v8.0.11...v8.0.12

## 8.0.11

[Release](https://github.com/dotnet/core/releases/tag/v8.0.11)

## What's Changed
* Update branding to 8.0.11 by @​vseanreesermsft in
dotnet/efcore#34807
* [release/8.0] Remove referencing indexes when reconfiguring a property
as a navigation by @​AndriySvyryd in
dotnet/efcore#34651
* [release/8.0] Update dependencies by @​AndriySvyryd in
dotnet/efcore#34822
* [release/8.0] Update dependencies from dotnet/arcade by
@​dotnet-maestro in dotnet/efcore#34880
* [release/8.0] Update Microsoft.Extensions.HostFactoryResolver.Sources
version by @​AndriySvyryd in dotnet/efcore#34884
* [release/8.0] Don't execute empty batches by @​AndriySvyryd in
dotnet/efcore#34882
* [release/8.0] Avoid infinite recursion on identifying shadow FKs by
@​AndriySvyryd in dotnet/efcore#34891
* Merging internal commits for release/8.0 by @​AndriySvyryd in
dotnet/efcore#34902
* [release/8.0] Keep parameter values out IMemoryCache in
RelationalCommandCache by @​roji in
dotnet/efcore#34908


**Full Changelog**:
dotnet/efcore@v8.0.10...v8.0.11

## 8.0.10

[Release](https://github.com/dotnet/core/releases/tag/v8.0.10)

## 8.0.8

[Release](https://github.com/dotnet/core/releases/tag/v8.0.8)

Commits viewable in [compare
view](dotnet/efcore@v8.0.7...v8.0.22).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.EntityFrameworkCore.SqlServer&package-manager=nuget&previous-version=8.0.7&new-version=8.0.22)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.
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.

2 participants