Skip to main content

Posts

TDD in C# with xUnit and Moq: A Practical Guide

Recent posts

ASP.NET Core Health Checks: Complete Guide (2026)

Learn how to implement ASP.NET Core health checks to monitor databases, APIs & services. Step-by-step tutorial with code examples. Start monitoring now! ASP.NET Core Health Checks: Monitor Your Production App Like a Pro Your app is deployed. Users are active. Then at 2 AM, the database silently dies and nobody knows until customers start tweeting. Sound familiar? ASP.NET Core health checks solve this exact problem by giving you real-time visibility into the state of your application and its dependencies — databases, external APIs, message queues, disk storage, and more. In this guide, you'll learn how to implement health checks in ASP.NET Core from scratch, build custom health check logic, integrate with Kubernetes probes, and follow production-tested best practices that keep your systems observable and reliable. What Are Health Checks in ASP.NET Core? Health checks are HTTP endpoints that report whether your application and its dependencies are functioning correct...

Deploy ASP.NET Core to Azure App Service in 10 Minutes

Learn how to deploy ASP.NET Core to Azure App Service step by step. Follow this guide with CLI, Visual Studio & GitHub Actions examples. Start deploying now! Deploy ASP.NET Core to Azure App Service — A Complete Step-by-Step Guide If you have ever wondered how to deploy ASP.NET Core to Azure App Service without spending hours wrestling with configuration, you are in the right place. Azure App Service is Microsoft's fully managed platform for hosting web applications, REST APIs, and backend services. It handles infrastructure, patching, and scaling so you can focus on writing code. In this tutorial, you will learn three proven ways to deploy your ASP.NET Core application to Azure — using the Azure CLI, Visual Studio, and GitHub Actions for CI/CD. By the end, your app will be live on the internet with a real URL. What Is Azure App Service and Why Use It? Azure App Service is a Platform-as-a-Service (PaaS) offering that supports .NET, Node.js, Python, Java, and more...

ML.NET Tutorial: Build Your First ML Model in C#

Learn ML.NET with this step-by-step C# tutorial. Build, train, and deploy your first machine learning model in .NET with practical code examples. If you've ever wanted to add machine learning to a .NET application without leaving C#, this ML.NET tutorial is where you start. ML.NET is Microsoft's open-source, cross-platform framework that lets C# and F# developers build, train, and deploy custom machine learning models — no Python required, no context switching, just the language and ecosystem you already know. In this hands-on guide, you'll build a complete machine learning model in C# from scratch. We'll walk through real, runnable code that loads data, trains a binary classification model, evaluates its accuracy, and makes predictions — all using ML.NET in a standard .NET console application. By the end, you'll understand the ML.NET pipeline architecture, know how to pick the right algorithm for your problem, and have a working model you can integrate ...

C# Source Generators Tutorial — Automate Code at Compile Time

Learn C# source generators to automate code generation at compile time. Step-by-step tutorial with examples, best practices, and real-world use cases. What Are C# Source Generators? C# source generators let you inspect your code during compilation and automatically produce new C# files that become part of your project — no manual coding, no runtime reflection, no post-build scripts. Introduced with .NET 5 and Roslyn, they run inside the compiler itself, giving you a compile-time hook to eliminate boilerplate at the source. If you have ever written the same property-changed notification, the same mapping method, or the same serialization logic across dozens of classes, source generators in C# solve that problem permanently. The compiler writes the code for you, every time you build. In this tutorial you will build a working source generator from scratch, understand the API surface, learn the patterns that scale, and avoid the mistakes that waste hours of debugging. Why Us...

C# 13 New Features — Complete Guide With Examples (2026)

Learn all C# 13 new features with practical code examples. Params collections, partial properties, Lock type, and more — upgrade your .NET 9 skills today. C# 13 shipped with .NET 9 in November 2024, and by mid-2026 most teams have either adopted it or are planning their upgrade. Whether you're already using it in production or still evaluating the jump, this guide covers every C# 13 new feature with practical, runnable code examples so you can see exactly what changed and why it matters. This isn't a changelog copy-paste. We'll walk through each feature, explain the problem it solves, show before-and-after code, and flag the gotchas you'll hit in real projects. 1. params Collections — The Biggest Quality-of-Life Win in C# 13 Before C# 13, the params keyword only worked with arrays. That meant every call allocated a new array on the heap, even if the method just iterated over the values once. C# 13 lifts that restriction: params now works with any colle...