Skip to main content

Posts

ML.NET Image Classification: Train a Model in C#

Learn ML.NET image classification in C#. Step-by-step tutorial to train, evaluate, and deploy a custom image classifier in .NET. Start building today! If you have ever wanted to add image recognition to a .NET app without leaving C#, ML.NET image classification is the fastest way to get there. In this tutorial you will train a custom image classifier in C#, evaluate its accuracy, and deploy the trained model into a production .NET application — all using free, open-source tooling from Microsoft. No Python, no external ML services, and no PhD in deep learning required. ML.NET is Microsoft's cross-platform machine learning framework for .NET developers. It runs on Windows, macOS, and Linux, integrates directly with your existing C# codebase, and uses transfer learning under the hood so you can build an accurate model with only a few hundred images. By the end of this guide you will understand not just how to build an image classifier, but why each step matters. What Is ML....

ASP.NET Core REST API Tutorial 2026: Build a Production API

Learn how to build a production-ready ASP.NET Core REST API in 2026. Step-by-step C# tutorial with CRUD, EF Core, and best practices. Start coding now! If you searched for an ASP.NET Core REST API tutorial , you want more than a "Hello World" endpoint — you want to ship something real. In this 2026 guide you will build a production-ready ASP.NET Core Web API from scratch: clean CRUD endpoints, Entity Framework Core persistence, validation, versioning, authentication, and the small architectural decisions that separate a demo from a deployable service. Every code sample is runnable on .NET 9, and by the end you will understand not just how each piece works, but why it belongs in a professional API. This tutorial targets three readers at once: beginners learning how to build a REST API in C# , intermediate developers looking for ASP.NET Core best practices , and seniors who want the advanced patterns. Skim to your level, or read straight through. Why ASP.NET Core for...

Generative AI in .NET: Architecture Patterns for C# Apps

Learn generative AI in .NET with proven enterprise patterns — RAG, Semantic Kernel, streaming, and resilience in C#. Start building smarter apps today. Generative AI in .NET has moved from experiment to expectation. In 2026, enterprise teams across the USA, UK, Canada, Australia, and India are being asked to ship AI copilots, document summarizers, and intelligent search into existing C# applications — and to do it with the same reliability standards as any other production service. The problem? Most tutorials show you how to call an LLM API in ten lines, then leave you alone with the hard parts: architecture, grounding, resilience, cost control, and testing. This guide covers the architecture patterns that actually matter when you integrate generative AI into .NET enterprise apps: the abstraction layer, Retrieval-Augmented Generation (RAG), streaming, tool calling, and the operational guardrails that keep an AI feature from becoming a production incident. Every example is runna...

ASP.NET Core Rate Limiting: Protect Your API (2026)

Learn ASP.NET Core rate limiting with built-in .NET middleware. Fixed window, sliding window, token bucket & code examples. Secure your API today! If your API is public, it will be abused — by scrapers, misconfigured clients stuck in retry loops, brute-force login bots, or a single power user hammering an expensive endpoint. ASP.NET Core rate limiting is the first line of defense, and since .NET 7 it has been built directly into the framework via the Microsoft.AspNetCore.RateLimiting middleware — no third-party packages required. In this tutorial you'll learn how to configure all four built-in rate limiting algorithms in .NET 8, 9, and 10, how to apply limits per user or per IP address, how to return proper 429 Too Many Requests responses, and the pitfalls that trip up production deployments (especially behind load balancers). Why Rate Limiting Matters in 2026 Rate limiting is not just a security checkbox. It solves several distinct problems, and knowing which pro...

C# Collections Performance: List vs Dictionary vs HashSet

Master C# collections performance: List vs Dictionary vs HashSet vs Queue with Big-O tables, real benchmarks, and code examples. Pick the right one today. Choosing the right data structure is one of the highest-leverage performance decisions you can make in .NET — and C# collections are where most of those decisions happen. Should you use a List<T> or a Dictionary<TKey, TValue> ? When does a HashSet<T> beat both? And where does Queue<T> fit in? In this guide, we'll compare the four most-used collections in C# with Big-O complexity tables, runnable benchmark code, and clear rules for when to use each. By the end, you'll be able to justify your collection choice in a code review — not just guess. Why C# Collections Performance Matters Every collection type in .NET makes a trade-off. List<T> gives you cheap indexed access and great iteration speed but slow lookups by value. Dictionary<TKey, TValue> gives you near-instant lookups...

API Versioning in ASP.NET Core: Complete Guide (2026)

Learn API versioning in ASP.NET Core with real code examples — URL, header, and query string strategies. Build APIs that never break clients. Start now! API versioning in ASP.NET Core is one of those topics every backend developer eventually runs into — usually the hard way. You ship an API, mobile apps and third-party clients start depending on it, and then the business asks for a change that would break every one of them. Versioning is how you evolve your API without burning down the integrations built on top of it. In this guide, you'll learn the four main API versioning strategies, how to implement each one in ASP.NET Core using the official Asp.Versioning packages, how to version Minimal APIs, and the best practices (and pitfalls) that separate a maintainable API from a support nightmare. Why API Versioning Matters An API is a contract. Once a client — a React frontend, an iOS app, a partner's integration — starts consuming it, you no longer fully own its sha...

How to Dockerize an ASP.NET Core App in .NET 9

Learn how to dockerize an ASP.NET Core app in .NET 9 with a step-by-step Dockerfile tutorial, best practices, and deployment tips. Start containerizing today! If you want to dockerize an ASP.NET Core app , .NET 9 makes it easier than any previous release. Containers have become the default way to ship web applications — every major cloud (Azure, AWS, Google Cloud) runs them natively, and "it works on my machine" bugs largely disappear when your app ships with its entire runtime environment. In this tutorial, you'll learn how to containerize a .NET 9 ASP.NET Core application with a production-ready Dockerfile, understand why each instruction matters, run it locally with Docker Compose, and deploy it to the cloud. We'll also cover the built-in SDK container publishing feature that lets you skip the Dockerfile entirely. Why Dockerize an ASP.NET Core App? Before writing any code, it's worth understanding what containers actually buy you, because the "why...