.NET 5 is the fastest .NET version ever releases. The engineering team has gone through the runtime and libraries with a fine-toothed comb, optimizing everything from the impacts of the Garbage Collector (GC) to the internals of List<T>. Let’s look at the numbers. TechEmpower Benchmarks In the TechEmpower benchmarks (Round 19/20), .NET 5 performs exceptionally […]
Read more โTag: .NET
.NET 5 is Here: The Complete Migration Guide
.NET 5 is the first step in the “One .NET” vision, unifying .NET Core and Mono. It drops the “Core” branding but keeps the Core architecture. This guide covers the migration from .NET Core 3.1, highlighting the breaking changes and performance wins. Project File Changes Update your TFM (Target Framework Moniker). Single File Applications .NET […]
Read more โgRPC-Web: Bringing gRPC to Browser Applications
gRPC is great for microservices, but browsers don’t support HTTP/2 trailers required for standard gRPC. **gRPC-Web** is the protocol adaptation that makes it possible. In .NET, we can now host gRPC-Web services natively alongside standard gRPC. Configuring .NET Server Client Consumption Key Takeaways No need for an external Envoy proxy anymore (though still valid). Performance […]
Read more โC# 9.0 Init-Only Setters: Immutable Object Initialization
Before C# 9, to make a property immutable, you had to use constructor injection. This broke object initializers (`new Obj { Prop = val }`). The `init` accessor solves this by allowing setting a property only during object initialization. The ‘init’ Keyword Why this matters for DTOs It allows for consistent, valid state without massive […]
Read more โC# 9.0 Records: Immutable Data Types Done Right
Immutability is a cornerstone of robust distributed systems, but achieving it in C# has historically required copious boilerplate. C# 9.0 introduces Records, a first-class citizen for immutable data. Records provide value-based equality, non-destructive mutation, and concise syntax. The Syntax Evolution Value-Based Equality Records check equality by properties, not reference. Non-Destructive Mutation (‘with’ expressions) To modify […]
Read more โBlazor CSS Isolation: Scoped Styles in .NET 5
A preview feature for .NET 5 (arriving Nov 2020) is CSS Isolation. Similar to Vue’s `scoped` styles or React Modules, this prevents style leakage between components. How it Works Create a file matching the component name: `Counter.razor.css`. At build time, Blazor rewrites HTML with a unique attribute `b-123abc` and rewrites CSS: The Deep Combinator To […]
Read more โ