Blog Posts with tag "C#"

C# 15 Unions: Unions are finally in .NET

C# 15 Unions: Unions are finally in .NET

After many years of workarounds, design discussions and library-level substitutes, unions are finally becoming a first-class part of C#. The proposal in the C# language repository is no longer a distant idea. With the feature now appearing in the .NET 11 preview train as an early C# 15 capability, the direction is concrete enough to discuss in practical terms.

Read Blog Post
Unio: High-Performance Discriminated Unions for C#

Unio: High-Performance Discriminated Unions for C#

C# is a powerful language, but there is one road it has not yet fully paved: native discriminated union types. Developers have been working around this absence for years, typically choosing between throwing exceptions for non-exceptional paths, returning nullable values, using out parameters or layering custom wrapper classes on top of every service boundary. Each of these approaches carries a cost - in clarity, type safety or runtime efficiency.

Read Blog Post
.NET 11 Preview 1 Is Here: What's New and What to Expect

.NET 11 Preview 1 Is Here: What's New and What to Expect

The .NET team just released the first preview of .NET 11 and there is already a lot to talk about. While this is an early preview - not a release candidate - the breadth of changes touching the runtime, libraries, ASP.NET Core, Blazor, C#, the SDK and Entity Framework Core gives a clear picture of where the platform is heading. Let me walk you through the most important changes you should know about.

Read Blog Post
Create a Local SQL Server Database File with .NET

Create a Local SQL Server Database File with .NET

Local SQL Server database files provide a pragmatic way to keep a real SQL Server engine close to the application without provisioning a full server. A LocalDB database lives in a single .mdf file (plus a log file), runs in user mode and behaves like SQL Server for most application scenarios. That makes it a strong fit for local development, integration tests and tooling that needs relational features without the overhead of infrastructure setup.

Read Blog Post
Build a Custom FeatureGate Attribute in ASP.NET Core with C#

Build a Custom FeatureGate Attribute in ASP.NET Core with C#

Feature management is a key technique in modern web applications, allowing you to enable or disable features dynamically without redeploying your code. In ASP.NET Core, the Microsoft.FeatureManagement library provides a robust way to implement feature flags. But what if you want to ensure that administrators can always access certain features, even if those features are disabled for regular users?

Read Blog Post