Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Model Binding: Binding Request Data to Your Method (Route, Query, Body, Header)
We cover how .NET automatically binds request data to your method parameters: reading from the route, query string, body and headers, attributes like [FromBody], and common mistakes.
HTTP Status Codes and Returning the Right Response: IActionResult and Results
We cover HTTP status codes and the ways to return the right response. Which code for which situation, the difference between IActionResult and Results, and small details that help API consumers.
Writing Your First Controller: Routing, Attributes and Action Methods
We write our first real controller. How routing works, what attributes do, how action methods are built, and how an incoming request reaches the right method, step by step.
Controllers or Minimal APIs? When to Choose Which
We compare two ways of writing endpoints in .NET 9: controller-based structure and Minimal APIs. When each makes sense and what the real difference is, made clear with examples.
Setting up the initial project: project structure, Program.cs, and a minimal hosting model.
We set up our first .NET 9 Web API project. We break down Program.cs line by line, and understand the minimal hosting model, the builder-versus-app split, and why middleware order matters.
Introduction to Web APIs with .NET 9: REST principles and why .NET?
The first article of the .NET 9 Web API series. We cover REST principles, resource-oriented thinking, HTTP methods, and why we chose .NET 9, in a plain, example-driven style.