Skip to content

Upgrade to linq2db v6 / EF Core 10#2282

Draft
myieye wants to merge 10 commits into
developfrom
feat/linq2db-v6-ef-core-10
Draft

Upgrade to linq2db v6 / EF Core 10#2282
myieye wants to merge 10 commits into
developfrom
feat/linq2db-v6-ef-core-10

Conversation

@myieye
Copy link
Copy Markdown
Collaborator

@myieye myieye commented May 20, 2026

Upgrades linq2db v5→v6 (linq2db.EntityFrameworkCore 9.0.0→10.3.0) and EF Core 9→10. The general .NET 10 package bump (MAUI, Quartz migration, routes, WritingSystemId TypeConverter, RichMultiString IDictionary<,>, harmony to 50b0e2da) was already merged by PR #2264. This PR adds only what Robin did not do.

Key changes:

  • Package versions: linq2db.Extensions 6.2.1, linq2db.EntityFrameworkCore 10.3.0, EF Core 10.0.7, Npgsql 10, NeinLinq 7.4, OpenIddict 7.5, Gridify 2.19 (Directory.Packages.props)
  • Shadow properties for json_each: linq2db v6 changed how json_each expressions translate; EF Core shadow properties carry the raw JSON into the linq2db layer so queries compile and produce correct SQL without affecting entity materialization (see LINQ2DB-V6-NOTES.md for full investigation)
  • Linq2DbCctorPatcher: linq2db v6's SqlTransparentExpression has a broken static ctor that crashes Android on first CRDT save; a Cecil-based MSBuild task nops it out at build time
  • EF Core 10 follow-ons: RichMultiString null-setter, Entry/Sense model adjustments, updated test snapshots, FluentAssertions pinned to 7.0.0-alpha.5 (8.x has O(N!) BeEquivalentTo regression)
  • harmony: bumped from 50b0e2da (PR Bump pretty much ALL packages for .NET 10 #2264) to 96a75b26 which adds the HasCommit TOCTOU fix (check now inside the lock in DataModel.Add)

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4eff9cf6-663a-4eb8-bb72-aac830b38341

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/linq2db-v6-ef-core-10

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related 📦 Lexbox issues related to any server side code, fw-headless included labels May 20, 2026
@myieye myieye marked this pull request as draft May 20, 2026 15:23
myieye and others added 5 commits May 20, 2026 17:37
linq2db.AspNet+linq2db.EntityFrameworkCore 9.0.0 (v5 API) → linq2db.Extensions
6.2.1 + linq2db.EntityFrameworkCore 10.3.0 (v6 API). EF Core 9.0.x → 10.0.7,
Npgsql 9→10, NeinLinq 7.3→7.4, OpenIddict 7.1→7.5, Gridify 2.17→2.19. Robin's
PR #2264 handled everything else in the .NET 10 bump; this PR covers only the
linq2db/EF Core upgrade and its specific workarounds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
linq2db v6 changed how json_each expressions are translated: it now fires
ExpressionMethodAttribute substitutions at materialization time as well as in
queries, which breaks the IList<T> jsonb columns (SemanticDomains, PublishIn).
Shadow EF Core properties carry the raw JSON value into the linq2db query layer
so json_each rewrites work without affecting entity materialization. See
LINQ2DB-V6-NOTES.md for the full investigation and attempt history.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
linq2db v6's SqlTransparentExpression has a broken static constructor that
crashes on Android at startup (AOT static-ctor ordering issue). A Cecil-based
MSBuild build task patches the IL at build time to nop out the offending ctor.
SqlTransparentExpressionCctorRepro.cs documents the crash-reproduction test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dates

RichMultiString gains an explicit null-setter so the typed IDictionary<,>
implementation satisfies EF Core 10's stricter property requirements. Entry and
Sense get minor model adjustments. Snapshot/test expectations updated for EF
Core 10 query output changes. FluentAssertions global config pinned to
alpha.5 to avoid the 8.x O(N!) BeEquivalentTo regression in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Advances from 50b0e2da (Robin's PR #2264 base) to 96a75b26 which adds the
HasCommit TOCTOU fix: the commit-presence check now happens inside the lock
in DataModel.Add, preventing a race where two concurrent callers could both
pass the check and then collide on insert.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@myieye myieye force-pushed the feat/linq2db-v6-ef-core-10 branch from 8367545 to c687e40 Compare May 20, 2026 15:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

UI unit Tests

  1 files  ±0   59 suites  ±0   25s ⏱️ -3s
176 tests ±0  176 ✅ ±0  0 💤 ±0  0 ❌ ±0 
245 runs  ±0  245 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 713bafc. ± Comparison against base commit e362dd4.

♻️ This comment has been updated with latest results.

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 20, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - May 21, 2026, 3:51 PM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

C# Unit Tests

165 tests   165 ✅  26s ⏱️
 23 suites    0 💤
  1 files      0 ❌

Results for commit 713bafc.

♻️ This comment has been updated with latest results.

myieye and others added 5 commits May 21, 2026 09:31
Extract ReplaceBodyWith helper, use Type.EmptyTypes ctor lookup for
NotImplementedException, drop a duplicate <IsPackable>, fill in the
upstream PR URL (linq2db/linq2db#5546).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The linq2db v6 + EF Core 10 work in 8d2b22a and 525cfd7 accidentally
reverted PR #2278 ('Use named GUIDs for predefined-data seed commits').
This restores PreDefinedData, CrdtProjectsService, CurrentProjectService,
the MiniLcmApiFixture call site, and the UUIDNext PackageReference, while
keeping the intended linq2db.AspNet -> linq2db.Extensions rename.
EF Core 10's Model.ToDebugString output drops empty 'DiscriminatorProperty:'
annotations, emits explicit Required/Optional on navigations, and reports its
own version. All cosmetic; no model change.
- Drop a stale TODO and a "v6 dropped MakeTryConvert" comment that don't
  earn their keep
- Tighten the Sql.Alias / ExposeExpressionVisitor comment to name the
  specific linq2db version it describes
- Reword the RichMultiString JsonPatch repro test comment to focus on
  what it actually covers (Entry-routed patch via IDictionary.Add)
- Swap RichMultiString.CopyTo / Remove back to their original order
10.0.7 -> 10.0.8 across AspNetCore / EntityFrameworkCore / Extensions /
System.* / OpenApi, and 10.5.0 -> 10.6.0 for the Extensions rolling
packages (Caching.Hybrid, Http.Resilience, ServiceDiscovery,
TimeProvider.Testing). DbModel snapshot follows EF Core's ProductVersion.

Held back deliberately:
- linq2db 6.2.1 / linq2db.EntityFrameworkCore 10.3.0 — upstream PR #5546
  (SqlTransparentExpression cctor fix that would let us drop the IL
  patcher) targets linq2db 6.4.0 and is not yet merged. 10.4.0 ships
  6.3.0 and still has the buggy reflection, so bumping buys nothing.
- FluentAssertions 7.0.0-alpha.5 — pinned to dodge an 8.x BeEquivalentTo
  perf regression that pushes FwLite CI past its 60-min timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related 📦 Lexbox issues related to any server side code, fw-headless included

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant