Skip to main content

Posts

Recent posts

Authentication vs Authorization in ASP.NET Core Guide

Learn authentication vs authorization in ASP.NET Core with practical C# code, JWT, and policy examples. Secure your .NET apps the right way—start now. If you are building secure web APIs or web apps in .NET, understanding authentication vs authorization in ASP.NET Core is the single most important security skill you can master. These two concepts are constantly confused—even in production code reviews—yet they protect completely different things. Authentication answers "Who are you?" while authorization answers "What are you allowed to do?" Get them wrong, and you ship either a locked-out app or a data breach waiting to happen. In this complete security guide, you'll learn exactly how ASP.NET Core authentication and authorization work under the hood, see runnable C# code for JWT, role-based, and policy-based access control, and walk away with the best practices and common pitfalls that senior .NET engineers use to keep apps secure. Authentication ...

Local AI with Ollama and C#: Run LLMs Free in 2026

Learn how to run local AI with Ollama and C#. Set up free local LLMs on your own machine with runnable code examples. Start building offline AI apps today. Want to build AI features without paying per API call or shipping your users' data to a cloud provider? Running local AI with Ollama and C# lets you host large language models (LLMs) directly on your own machine — completely free, fully offline, and privacy-first. In this tutorial you'll learn how to run an LLM locally in C#, call it from your .NET applications, stream responses, and build production-ready patterns that scale. Whether you're a beginner searching for "how to run LLM locally" or a senior engineer evaluating self-hosted AI for C#, this guide has runnable code and the reasoning behind every decision. Why Run Local AI with Ollama and C#? For most of the last few years, adding AI to a .NET app meant calling a hosted API. That works, but it comes with three persistent problems: cost (you pa...

C# Unit Testing with xUnit: TDD Tutorial for Beginners

Learn C# unit testing with xUnit and test-driven development in this complete tutorial. Master TDD, assertions, mocking, and best practices. Start testing today! C# unit testing is one of the most valuable skills a .NET developer can master, yet it's often the most overlooked. If you've ever shipped code that broke in production, spent hours debugging a regression, or felt afraid to refactor legacy code, then learning C# unit testing with xUnit and test-driven development (TDD) will change how you build software forever. In this complete tutorial, you'll learn how to write reliable, maintainable unit tests in C# using xUnit—the most popular testing framework in the modern .NET ecosystem. Whether you're a beginner searching for your first C# unit test example , an intermediate developer looking for best practices, or a senior engineer adopting test-driven development, this guide covers everything you need with practical, runnable code. What Is Unit Testing in...

AI Agents in C# with Semantic Kernel: Full Tutorial

Learn how to build AI agents in C# using Semantic Kernel. Step-by-step tutorial with runnable code, best practices, and pitfalls. Start building today! Building AI agents in C# used to mean wiring up raw HTTP calls to a large language model and parsing JSON by hand. Today, Microsoft's Semantic Kernel gives .NET developers a production-ready framework for creating autonomous task-solving agents that can reason, call your code, and chain multiple steps together to complete real work. In this tutorial you'll learn how to build AI agents in C# from scratch using the Semantic Kernel Agent Framework, with runnable code examples, best practices, and the common pitfalls to avoid. Whether you're a beginner searching for "how to build an AI agent in C#," an intermediate developer looking for Semantic Kernel best practices, or a senior engineer designing advanced agent architectures in .NET, this guide covers the full picture — and explains why each piece matters...

Infrastructure as Code in C# with Pulumi: .NET Guide

Learn Infrastructure as Code with C# using Pulumi for .NET. Deploy cloud resources with real code, examples, and best practices. Start building today! For years, .NET developers had to step outside their comfort zone to provision cloud infrastructure — learning HCL, YAML, or clicking through cloud consoles. Infrastructure as Code in C# changes that. With Pulumi, you can define your entire cloud stack — virtual machines, storage, networking, Kubernetes clusters — using the same C# language, IDE, and tooling you already use every day. In this tutorial, you'll learn how to use Pulumi for .NET to build, deploy, and manage real cloud infrastructure with strongly typed, testable, production-ready code. Whether you're a beginner searching for how to get started, an intermediate developer looking for best practices, or a senior engineer evaluating Pulumi vs Terraform , this guide covers the why and the how with runnable examples. What Is Infrastructure as Code (IaC)? ...

API Versioning in ASP.NET Core: A Complete Guide

Learn API versioning in ASP.NET Core with practical C# examples. Master URL, header & query string strategies. Start versioning your APIs the right way today. API versioning in ASP.NET Core is one of those topics every backend developer eventually runs into — usually the hard way, right after a "small change" breaks a mobile app in production. If you build REST APIs with C# and .NET, learning how to version your endpoints properly is not optional; it is the difference between shipping confidently and dreading every deployment. In this complete guide, we'll cover the main API versioning strategies in ASP.NET Core, show runnable code examples for both controller-based and minimal APIs, and explain the why behind each decision so you can pick the right approach for your project. Why API Versioning in ASP.NET Core Matters An API is a contract. The moment a client — a web app, a mobile app, or a third-party integration — starts consuming your endpoints, you ha...