Newsletter Archive
Browse through our collection of past newsletters. Each edition is packed with C# and .NET insights.
Page 5 of 5 (13 editions)
Create and Read JWT Tokens in C# .NET
A quick, code-first walkthrough of creating and reading JWTs in C# using System.IdentityModel.Tokens.Jwt covering claim selection, HMAC-SHA256 signing, and parsing token headers/claims without validation. It emphasizes real-world guardrails (JWTs are readable, validate on the backend, set expirations, and prefer certificates over shared secrets) and points toward production patterns like refresh tokens and role-based authorization. A tidy primer whether you’re prototyping an auth flow or tightening up an API.
How to generate Code Coverage for a .NET Solution
David Guida walks through wiring up Coverlet to generate solution‑wide code coverage in .NET, including a GitHub Actions pipeline that merges results across test projects, outputs both JSON and OpenCover, and drives a README badge. He also covers the real-world gotchas: running tests sequentially (-m:1) to avoid cross-project contamination and excluding test assemblies via a .runsettings file so your numbers actually mean something. A tidy, copy‑pasteable setup to keep your .NET 8 codebase honest without a build-pipeline yak shave.
Azure Cost Estimation: Your Strategic Guide to Cloud Pricing
Azure Essentials tackles unpredictable cloud bills with a practical, three-layer approach to estimating Azure costs architecture, configuration, and usage so your .NET workloads don’t surprise the finance team. Thomas Maurer and Britt walk through modeling scenarios with the Azure Pricing Calculator and Azure Migrate, then show how Azure Advisor, Cost Management, Copilot in Azure, and Monitor help refine and optimize over time. A clear, developer-friendly blueprint for turning “it depends” into numbers you can plan around.
C# 14 in Action: High-Performance Lambda Expressions with Parameter Modifiers
C# Corner breaks down how C# 14 levels up lambdas with parameter modifiers (ref, in, out), pushing them closer to full method parity for clearer intent and faster paths in real-world code. Through scenarios like hot-loop updates, large-struct reads, Try-parse patterns, and buffer processing, it shows how these enhancements trim boilerplate, improve API design, and keep performance-sensitive code as readable as your favorite LINQ.
7 Mistakes .NET Developers Should Avoid
This concise guide calls out seven career-slowing pitfalls for .NET devs and offers practical upgrades: move from .NET Framework to .NET 6/7/8 and ASP.NET Core, write cleaner SOLID code, practice C# problem-solving, and get comfortable with Azure, Docker, Git, and CI/CD. It also reminds us that communication, documentation, and tests aren’t extras they’re how you ship confidently. A friendly gut-check for keeping skills sharp and relevant.
Digital Essentialism in .NET: How Verdict is Redefining the Result Pattern
Meet Verdict, a ‘digital essentialism’ take on the Result pattern for .NET that uses a readonly struct to keep the happy path allocation-free backed by eye-popping benchmarks (e.g., 189x faster than FluentResults) and far less GC pressure. It pairs the lean core with opt-in goodies like ASP.NET Core ProblemDetails mapping, LoggerMessage-based logging, async chaining, and multi-error validation handy for APIs and microservices chasing lower latency and lower cloud costs.
Enjoying these links? 💜
Get them delivered to your inbox every Monday, Wednesday, and Friday.
Partial Events and Constructors in C# 14 (.NET 10) Explained with Examples
C# 14 (on .NET 10) introduces partial constructors and partial events, finally letting you split initialization and event accessors across files so source-generated and hand-written code play nicely together. The article walks through practical patterns init hooks, customizable add/remove accessors, and generator-friendly APIs plus gotchas, best practices, and why there’s no runtime cost. A tidy upgrade for anyone juggling source generators, ORMs, or UI frameworks who wants cleaner seams and fewer merge headaches.
Hybrid Cache & Output Caching in .NET: A Game Changer for High-Performance Applications
A friendly walkthrough of Hybrid Cache and Output Caching in modern ASP.NET Core, showing how Hybrid Cache marries IMemoryCache speed with distributed stores (like Redis) behind a single, resilient API while Output Caching serves full HTTP responses instantly. With clear code snippets and a realistic e‑commerce scenario, it highlights when these patterns shine (and when they don’t) and the kind of gains you can expect think ~300ms down to ~20ms and far fewer DB hits on read‑heavy endpoints. Less cache plumbing, more throughput.
SQL Server Regular Expression Performance and Guidelines
SQL Server 2025 brings native regex functions to T‑SQL (compat level 170), and Ben Johnston road-tests them with practical, real-world guidance. The headline: REGEXP_REPLACE is often a big win that simplifies gnarly text cleanup, but REGEXP_LIKE can be 10–50x slower than LIKE on big tables and tends to scan rather than seek so filter first and test, especially with Unicode. He maps each regex function to its legacy counterpart, showing where they shine (imports/parsing) and when the old standbys are still the better choice.
Changing Immutable Collections
Jon Skeet explains why, for build-once/read-many workloads, FrozenDictionary and ImmutableArray can beat ImmutableDictionary and ImmutableList and shows the usage patterns that make the difference. He details a mostly drop-in migration (new namespace, Count→Length, value-type nullability tricks with .Value or pattern matching) and the real-world gotchas. The payoff: read-heavy validation fell from ~5.5ms to ~0.826ms, with some naming nitpicks and value-type awkwardness as the only lingering gripes.
What’s New with APIs in .NET 10: Taking a Look at Real Improvements
Dave Brock walks through .NET 10 and C# 14 from an API developer’s seat, using a tidy order-management API to show why the changes matter in practice. Highlights include built-in Minimal API validation with ProblemDetails, OpenAPI 3.1 (including YAML endpoints), SSE support, and EF Core 10’s named query filters for safer multi-tenant data plus C# 14’s field keyword, null-conditional assignments, and extension members to trim boilerplate. A practical, no-drama tour of upgrades that make APIs cleaner, better documented, and easier to evolve.
C# Smart Enums: advanced
Part 3 of the Smart Enums series shows how to end the copy‑paste parade by moving enum lookup logic into a generic base class that uses the CRTP pattern. With a per‑type static dictionary, Initialize() to skip reflection, and Get/GetOrDefault/TryGet APIs, you get O(1) lookups, strict type safety, and zero boilerplate perfect when your app juggles lots of status types. Tested on .NET 6, with references to generics constraints and Ardalis.SmartEnum for production‑grade inspiration.