Reflection is slow. It happens at runtime, bypasses type safety, and prevents trimming. Source Generators solve this by generating code at compile time. In this guide, we build a generator that automatically implements a `MapTo` method for DTOs, replacing AutoMapper. The Goal The Generator Logic Key Takeaways Source Generators enable **Zero-Overhead abstractions**. They are essential […]
Read more βCategory: Emerging Technologies
Emerging technologies include a variety of technologies such as educational technology, information technology, nanotechnology, biotechnology, cognitive science, psychotechnology, robotics, and artificial intelligence.
Securing SPAs: The Backend for Frontend (BFF) Pattern
Storing Access Tokens (JWT) in LocalStorage is insecure (XSS vulnerability). Storing them in HttpOnly cookies is safer, but SPAs can’t read cookies. The solution? The **Backend for Frontend (BFF)** pattern. The Architecture Using YARP (Yet Another Reverse Proxy) Microsoft’s YARP is the perfect tool to build a .NET BFF. Key Takeaways **Zero Tokens in Browser**: […]
Read more βHigh Performance C#: Span and Memory
`Span<T>` allows you to work with contiguous memory regions (Arrays, Stack, Native Heap) without allocating new objects. It’s the secret sauce behind Kestrel’s speed. Slicing without Allocation Stackalloc Allocate memory on the stack (super fast, auto-cleaned) instead of the heap (GC pressure). Key Takeaways `Span<T>` is a `ref struct`, meaning it can only live on […]
Read more βAzure Durable Functions: Fan-Out/Fan-In Pattern
The Fan-Out/Fan-In pattern allows you to execute tasks in parallel and then aggregate the results. This is famously difficult in standard serverless, but trivial with Durable Functions. The Orchestrator How it Scales Key Takeaways The Orchestrator function replays from the start after every `await`. Avoid non-deterministic code (like `DateTime.Now`) inside the orchestrator logic. Activities run […]
Read more βAzure Functions 3.0 to 4.0: Performance Deep Dive
With the release of Azure Functions 4.0 (running on .NET 6), the performance landscape for serverless has shifted dramatically. Upgrading from 3.0 (.NET Core 3.1) isn’t just a version bump; it is an overhaul of the worker process. Cold Start Analysis The “Cold Start” is the time it takes for Azure to provision your instance […]
Read more βPlaywright vs Selenium in 2021
For a decade, Selenium was the king of E2E testing. But modern SPAs (React/Vue) flakiness made it painful. Microsoft’s Playwright (fork of Puppeteer) offers a faster, more reliable alternative by using the DevTools Protocol directly. Auto-Waiting Playwright waits for elements to be actionable checks prior to performing actions. No more `Thread.Sleep(5000)`! Browser Contexts Run isolated […]
Read more β