Skip to content

Instantly share code, notes, and snippets.

@carlosschults
Created May 4, 2026 12:09
Show Gist options
  • Select an option

  • Save carlosschults/82b7a2de3a033345156f0df9d953f032 to your computer and use it in GitHub Desktop.

Select an option

Save carlosschults/82b7a2de3a033345156f0df9d953f032 to your computer and use it in GitHub Desktop.
New C# and .NET Features

C# 14

Extension members are the headliner. The new syntax enables extension properties, extension operators, and static extension members — all defined in a unified extension block. It's fully compatible with existing extension methods. This is a big deal: you can now attach properties and operators to types you don't own, including interfaces and sealed classes.

The field keyword is the second most impactful quality-of-life change. It allows field-backed properties to eliminate explicit backing fields — the compiler generates the backing field automatically, making code cleaner and more maintainable. Perfect for the "I need some logic in a setter but don't want a manual field" pattern that comes up constantly.

Null-conditional assignment (?.=) lets you use null-conditional operators on the left side of assignments, through constructs like customer?.Order = ....

User-defined compound assignment operators: you can now overload +=, *=, and similar operators. Previously, += would call the overloaded + then assign, creating extra copies. With value types like mathematical vectors this caused unjustified performance costs from copying. Now you can do in-place mutation.

Implicit span conversions: array slices like buffer[..8] automatically convert to Span<T> or ReadOnlySpan<T> without explicit .AsSpan() calls.

Partial constructors and events: C# 14 extends partial types to support partial events and partial constructors, improving compatibility with source generators.

Lambda parameter modifiers without explicit types: you can add modifiers like scoped, ref, in, out, or ref readonly to lambda parameters without having to spell out the full parameter type.

nameof on unbound generics: nameof(List<>) now evaluates to "List". Previously only closed generic types like nameof(List<int>) were supported.


.NET 10 (LTS — supported until November 2028)

Performance is a major story. The JIT compiler takes full advantage of AVX-512, AVX10.2, and ARM SVE/SVE2 vector extensions, delivering 15–30% raw performance gains on recent hardware with no code changes required. Loop inversion, stack allocation strategies, and write-barrier changes contribute to measurable reductions in memory usage and GC pauses.

JIT devirtualization improvements: the JIT can now devirtualize array interface methods — so iterating over an array via IEnumerable<T> can be optimized the same way as direct array iteration.

EF Core 10 gets some notable additions: vector search support for SQL Server 2025 and Azure SQL (enabling semantic search/RAG), a native JSON type for SQL Server 2025, full-text search functions (FullTextContains, etc.), and hybrid search combining vector similarity and full-text ranking.

Post-quantum cryptography: support expanded with ML-DSA (including HashML-DSA and Composite ML-DSA), Windows CNG integration, and AES KeyWrap with Padding.

ASP.NET Core 10 includes Blazor improvements, OpenAPI enhancements, and minimal API updates. The SDK now supports file-based apps with publish support and native AOT, one-shot tool execution via dotnet tool exec, and console apps that can natively create container images.

JSON serialization: new options include disallowing duplicate properties, strict serialization settings, and PipeReader support for improved efficiency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment