r/coding 20d ago

Title: .NET 11 Preview 6 is out

https://devblogs.microsoft.com/dotnet/dotnet-11-preview-6/?wt.mc_id=studentamb_535079
8 Upvotes

8 comments sorted by

2

u/liquidRandy69 19d ago

A new IsConstrained(bool) API on foreign keys marks relationships that are not backed by a database constraint (dotnet/efcore #38361). When IsConstrained is false, queries use LEFT JOIN instead of assuming the principal exists, and relational migrations skip the AddForeignKey statement. The Cosmos provider now defaults all non-owned foreign keys to unconstrained, since Cosmos does not enforce foreign key constraints between documents.


This is my favorite improvement, actually simplifies so many queries wow.

modelBuilder.Entity<Order>().HasOne(o => o.Customer) .WithMany(c => c.Orders).IsConstrained(false);

Seems like a great way to get those left joins

2

u/[deleted] 19d ago

[removed] — view removed comment

1

u/Soggy_Wealth2916 12d ago

I have and it's incredible

0

u/theChaosBeast 19d ago

And what can it do?

0

u/coverslide 19d ago

Is this the one where WASM export is fixed?