Mert Özen Go Beyond the Code

Blog

Posts and series that take software and IT from the basics to advanced topics: from programming languages and databases to architecture and AI.

Series
1990 posts found
Global Error Handling in ASP.NET Core: Exception Middleware and ProblemDetails
Backend PART 18

Global Error Handling in ASP.NET Core: Exception Middleware and ProblemDetails

Starting from the real response of an unhandled exception on .NET 6, we move to UseExceptionHandler with an error controller, then to our own middleware that maps domain exceptions to 404/409/500 ProblemDetails.

4 Nov 2026 9 min 113
Async/Await and CancellationToken in ASP.NET Core: Carrying Cancellation All the Way to the Database
Backend PART 17

Async/Await and CancellationToken in ASP.NET Core: Carrying Cancellation All the Way to the Database

We watch threads return to the pool during await, measure how blocking code starves the thread pool, carry a CancellationToken from the action to EF Core, and cover the .Result and async void traps.

4 Nov 2026 8 min 89
Layered Structure in ASP.NET Core Web API: The Service Layer and the Repository Debate
Backend PART 16

Layered Structure in ASP.NET Core Web API: The Service Layer and the Repository Debate

We slim down a fat controller and hand its work to IBookService. A reusable Expression projection, scoped registration, why a generic repository hurts on top of EF Core, and how interfaces help testing.

4 Nov 2026 10 min 102
DTOs and Mapping in ASP.NET Core Web API: Hand Mapping, the AutoMapper License and Mapperly
Backend PART 15

DTOs and Mapping in ASP.NET Core Web API: Hand Mapping, the AutoMapper License and Mapperly

We see the cost of returning entities directly through real errors: overposting and circular references. Request/response DTOs, hand mapping and projection, AutoMapper's 2025 license change and CVE, and a short look at Mapperly.

4 Nov 2026 10 min 134
EF Core and SQLite in ASP.NET Core Web API: DbContext, the First Migration and CRUD
Backend PART 14

EF Core and SQLite in ASP.NET Core Web API: DbContext, the First Migration and CRUD

We add a data layer to an ASP.NET Core Web API with EF Core and SQLite: EF Core 6 and 10 package versions, BookstoreContext, the connection string, why DbContext is scoped, the first migration, async CRUD and the SQL in the console.

4 Nov 2026 9 min 142
Logging in ASP.NET Core: ILogger, Log Levels, Structured Logging and Serilog
Backend PART 13

Logging in ASP.NET Core: ILogger, Log Levels, Structured Logging and Serilog

We write logs with ILogger<T> in ASP.NET Core: categories, log levels, filters via appsettings and environment variables, structured logging with message templates, scopes, the LoggerMessage source generator and the Serilog version that supports net6.0.

4 Nov 2026 8 min 120
Configuration and the Options Pattern in ASP.NET Core: Provider Order, User Secrets and Validation
Backend PART 12

Configuration and the Options Pattern in ASP.NET Core: Provider Order, User Secrets and Validation

We see the order of ASP.NET Core configuration providers with real output: appsettings, environment variables, command line, user secrets. The Options pattern, IOptions vs IOptionsSnapshot vs IOptionsMonitor, and validation with ValidateOnStart.

4 Nov 2026 7 min 116
Dependency Injection in ASP.NET Core: Lifetimes and the Captive Dependency Trap
Backend PART 11

Dependency Injection in ASP.NET Core: Lifetimes and the Captive Dependency Trap

We explore dependency injection in ASP.NET Core with real output: constructor injection, singleton/scoped/transient lifetimes, captive dependencies, scope validation, IServiceProvider and the [FromServices] detail in .NET 6.

4 Nov 2026 10 min 107
ASP.NET Core Minimal APIs with .NET 6: MapGet, MapPost and How They Compare to Controllers
Backend PART 10

ASP.NET Core Minimal APIs with .NET 6: MapGet, MapPost and How They Compare to Controllers

MapGet, MapPost, MapPut and MapDelete with .NET 6 minimal APIs, parameter binding rules, Results helpers, filling in the missing validation by hand, grouping endpoints, and when to pick minimal APIs over controllers.

4 Nov 2026 8 min 164
Model Validation in ASP.NET Core: Data Annotations and FluentValidation
Backend PART 09

Model Validation in ASP.NET Core: Data Annotations and FluentValidation

Model validation with Data Annotations, ModelState and the automatic 400, customizing ValidationProblemDetails, custom attributes, IValidatableObject and FluentValidation 11.x, including culture pitfalls with Range and messages.

4 Nov 2026 8 min 112
Model Binding in ASP.NET Core: FromRoute, FromQuery, FromBody and FromHeader
Backend PART 08

Model Binding in ASP.NET Core: FromRoute, FromQuery, FromBody and FromHeader

How request data binds to action parameters from the route, query string, body, headers, forms and services, the inference rules of [ApiController], and why you get 415 and 400 errors, with real responses.

4 Nov 2026 8 min 129
Status Codes and Responses in ASP.NET Core: Ok, CreatedAtAction and ProblemDetails
Backend PART 07

Status Codes and Responses in ASP.NET Core: Ok, CreatedAtAction and ProblemDetails

Returning the right status code with ControllerBase helpers, the surprise 204 on null, CreatedAtAction and the Location header, choosing between 400/404/409, ProblemDetails and content negotiation, with real responses.

4 Nov 2026 8 min 102
Blog Map