Skip to main content

Posts

Azure AI Search with C#: Build Smart Search (2026)

Learn Azure AI Search with C# — index data, run vector and hybrid queries, and add RAG to your .NET app. Start building intelligent search today. If your application's search box still runs a LIKE '%term%' query against SQL Server, your users are quietly suffering. They type "cheap laptop for uni" and get zero results because your catalogue says "affordable notebook for students." Azure AI Search with C# fixes exactly this problem: it combines classic keyword search, vector embeddings, and semantic reranking into a single managed service that you can drive from .NET with a few dozen lines of code. In this tutorial you'll build a working search index from scratch, run keyword, vector, and hybrid queries, and finish with a Retrieval Augmented Generation (RAG) pattern that grounds an LLM in your own data. This guide targets .NET 9 and the Azure.Search.Documents v11 SDK. Every snippet is runnable. We'll explain why each design choice matter...
Recent posts

Natural Language Processing in C#: Complete ML.NET Guide

Learn natural language processing in C# with ML.NET — sentiment analysis, text classification, BERT and tokenizers. Copy the runnable code and ship today. If you have ever been told that serious machine learning only happens in Python, this guide is the counter-argument. Natural language processing in C# is a first-class scenario thanks to ML.NET, Microsoft's open-source ML framework that runs natively on .NET 8 and .NET 9. You can train a sentiment classifier, ship a multiclass support-ticket router, or run a BERT-family transformer — all inside the same solution as your ASP.NET Core API, with no Python runtime, no interop bridge, and no separate deployment pipeline. This complete guide walks through classical text featurization, deep-learning text classification, tokenization, embeddings, and the production pitfalls that bite teams six months in. Every code sample is runnable. Why Do NLP in C# Instead of Python? The honest answer: sometimes you shouldn't. If you ne...

ASP.NET Core Global Exception Handling: Complete Guide

Learn ASP.NET Core global exception handling with middleware, IExceptionHandler and Problem Details. Copy runnable C# examples and ship safer APIs today. If your API still wraps every action in a try/catch , you are paying a tax on every endpoint you write. ASP.NET Core global exception handling lets you catch, log, and format every unhandled exception in exactly one place — so your controllers stay focused on business logic and your clients always receive a predictable error payload. In this guide you will learn the three approaches that ship with .NET (exception handler middleware, custom middleware, and the modern IExceptionHandler interface), how to return standards-compliant Problem Details responses, and how to wire in structured logging with a correlation ID your support team can actually search. Everything here targets .NET 8 and .NET 9/10, and every snippet is runnable in a minimal API or MVC project. Why Global Exception Handling Matters Three concrete problems get ...

C# for Unity: Beginner to Advanced Guide (2026)

Learn C# for Unity from beginner to advanced in 2026 — MonoBehaviour lifecycle, coroutines, async, performance and DOTS. Start building games today. If you want to build games in 2026, learning C# for Unity is still the single highest-leverage skill you can pick up. Unity ships with C# as its only first-class scripting language, and the version of C# you write inside the editor today is a modern, fast, fully-featured language — not the cut-down dialect people remember from a decade ago. This guide walks you from your very first MonoBehaviour to advanced topics like the Job System, object pooling and allocation-free game loops, with runnable code you can paste straight into a project. Why C# for Unity Is Different From "Normal" C# Everything you know about .NET still applies — LINQ, generics, async , pattern matching, records. But Unity adds a layer on top that trips up almost every newcomer, and understanding it early will save you weeks. You don't own the ...

API Security Best Practices 2026: Secure REST APIs in C#

Learn API security best practices for 2026 with runnable C# and ASP.NET Core examples — JWT, rate limiting, BOLA fixes. Start hardening your REST API today. If you ship a REST API in 2026, you are running a public attack surface. Attackers no longer bother with your UI — they read your OpenAPI document, enumerate your endpoints, and hammer them directly. This guide covers the API security best practices that actually matter today, with runnable C# and ASP.NET Core examples you can drop into a real project. We will focus on the failures that show up in genuine breach reports: broken object-level authorization, weak token validation, missing rate limits, and secrets sitting in source control. Every example targets ASP.NET Core on .NET 8 or later, and each one explains why the control exists — because a security rule you do not understand is a security rule you will disable the first time it breaks a deployment. Why REST API Security Fails: The OWASP API Security Top 10 The OW...

Serilog .NET Tutorial: Structured Logging Best Practices

Learn Serilog structured logging in .NET with runnable C# examples, sinks, enrichers, and production best practices. Start logging smarter today. If you have ever opened a 400 MB text log file at 2 a.m. trying to figure out why one customer's checkout failed, you already understand why Serilog .NET exists. Traditional logging writes sentences. Serilog writes data. That single difference — structured logging instead of string concatenation — is what turns your logs from a wall of text into a queryable database of everything your application did in production. In this tutorial you will learn how to set up Serilog in a .NET 8/9 application, configure sinks and enrichers, use scopes and correlation IDs, and apply the production best practices that separate a hobby project from a system you can actually operate. Every example is runnable. What Is Structured Logging (and Why String Logs Fail) Consider the classic approach: // The old way — information is destroyed at write ti...