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 →Search Results for: name
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 →Event-Driven Architecture with Azure Event Grid
Azure Event Grid is the backbone of event-driven architectures on Azure. It’s a fully managed event routing service that uses a publish-subscribe model. Unlike messaging services (Service Bus, Event Hubs), Event Grid is optimized for reactive programming patterns where you want instant notifications of state changes. Event Grid Architecture Key Concepts Topics are endpoints where […]
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 →Azure Arc for Kubernetes: Unified Hybrid Cloud Management
Azure Arc extends the Azure control plane (ARM) to resources running outside of Azure—on-premises, in AWS, or GCP. With Arc-enabled Kubernetes, you can manage any K8s cluster (OpenShift, Rancher, GKE) right from the Azure Portal. GitOps with Flux Arc agents installed in the cluster include Flux CD. You can push configurations via Azure Policy. Azure […]
Read more →Vue 3 Composition API: Practical Examples and Patterns
Now that Vue 3 is released, let’s dive deeper into the Composition API with practical examples you can use in real projects. I’ve been using the Composition API in production for several months via the Vue 2 plugin, and these patterns have proven invaluable. Understanding Reactivity Fundamentals The Composition API introduces two main reactive primitives: […]
Read more →