Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
153 posts found #backend
QueryMultiple and GridReader in Dapper: Several Result Sets in One Round Trip
Database PART 09

QueryMultiple and GridReader in Dapper: Several Result Sets in One Round Trip

We read several result sets from one command with Dapper's QueryMultiple and GridReader: why grids are read in order and only once, loading a master-detail order in one round trip, joining two result sets in memory, the unbuffered grid trap, and when to pick it over multi-mapping, all with real output.

6 Nov 2026 10 min 11
Multi-Mapping and splitOn in Dapper: Reading Related Data in a Single Query
Database PART 08

Multi-Mapping and splitOn in Dapper: Reading Related Data in a Single Query

We see how Dapper's multi-mapping cuts rows into column slices, the default splitOn = "Id" error, custom and comma-separated splitOn, the dictionary pattern for 1-N and null behavior on a LEFT JOIN, and we measure and fix the N+1 problem with a JOIN and IN @ids.

6 Nov 2026 11 min 12
Transactions with Dapper: BeginTransaction, Commit, Rollback and TransactionScope
Database PART 07

Transactions with Dapper: BeginTransaction, Commit, Rollback and TransactionScope

Starting from a half-written order, we set up BeginTransaction, the transaction: parameter, commit and rollback-on-dispose in Dapper, and see with real output why forgetting the parameter stays silent on SQLite, how isolation levels behave, and the async and SQLite traps of TransactionScope.

6 Nov 2026 10 min 15
Async and Connection Management in Dapper: CancellationToken, Pooling and DI
Database PART 06

Async and Connection Management in Dapper: CancellationToken, Pooling and DI

We see with real output why a CancellationToken only travels through CommandDefinition in Dapper, why async on SQLite actually runs synchronously, how connection pooling helps, why sharing one connection breaks, and the connection factory pattern in ASP.NET Core.

6 Nov 2026 11 min 14
INSERT, UPDATE, DELETE with Dapper Execute: Affected Rows and the New Id
Database PART 05

INSERT, UPDATE, DELETE with Dapper Execute: Affected Rows and the New Id

We run INSERT, UPDATE and DELETE with Execute and read the affected row count, get the new id with RETURNING and last_insert_rowid(), look at SQL Server OUTPUT and PostgreSQL RETURNING, and measure why Execute with a list is not bulk.

6 Nov 2026 10 min 10
Parameters and SQL Injection with Dapper: The Rules of a Safe Query
Database PART 04

Parameters and SQL Injection with Dapper: The Rules of a Safe Query

We see with a real attack why string concatenation opens the door to SQL injection, then look at anonymous objects, DynamicParameters, IN @Ids list expansion, DbString and the $ prefix, along with silent traps such as ORDER BY @Column.

6 Nov 2026 10 min 13
Single-Row Queries with Dapper: QueryFirst, QuerySingle and ExecuteScalar
Database PART 03

Single-Row Queries with Dapper: QueryFirst, QuerySingle and ExecuteScalar

We run QueryFirst, QueryFirstOrDefault, QuerySingle and QuerySingleOrDefault side by side with zero, one and many rows to see which exception each throws and when, along with the pitfalls of default(T), nullable types and ExecuteScalar<T>.

6 Nov 2026 10 min 14
Query and Mapping with Dapper: How Do Columns Map to Properties?
Database PART 02

Query and Mapping with Dapper: How Do Columns Map to Properties?

We look at how Query<T> maps columns to properties: case-insensitive matching, silently skipped columns, NULL and default values, MatchNamesWithUnderscores and its cache trap, dynamic results and constructor mapping for records.

6 Nov 2026 10 min 10
What Is Dapper? The Thin Layer on Top of ADO.NET and Your First Query
Database PART 01

What Is Dapper? The Thin Layer on Top of ADO.NET and Your First Query

We meet Dapper as a set of extension methods on top of ADO.NET: what micro-ORM means, when to pick it over EF Core, setting up .NET 10 + Dapper 2.1.89 + SQLite, the first Query and a short history from 1.x to Dapper.AOT.

6 Nov 2026 11 min 15
What's New in .NET 10: AddValidation, OpenAPI 3.1 and Server-Sent Events in ASP.NET Core
Backend PART 36

What's New in .NET 10: AddValidation, OpenAPI 3.1 and Server-Sent Events in ASP.NET Core

.NET 10 LTS brings AddValidation to minimal APIs, OpenAPI 3.1 and YAML, TypedResults.ServerSentEvents, System.Text.Json-based JSON Patch, dotnet run app.cs, C# 14 and breaking changes such as cookie auth 401/403.

4 Nov 2026 9 min 44
What's New in .NET 9: Built-in OpenAPI, Scalar and HybridCache in ASP.NET Core
Backend PART 35

What's New in .NET 9: Built-in OpenAPI, Scalar and HybridCache in ASP.NET Core

.NET 9 drops Swashbuckle from the template: AddOpenApi/MapOpenApi, transformers, Scalar and Swagger UI, stampede-safe HybridCache, TypedResults.InternalServerError, StatusCodeSelector, C# 13 and 24-month STS support.

4 Nov 2026 9 min 40
What's New in ASP.NET Core with .NET 8: Keyed DI, IExceptionHandler, Identity API and Native AOT
Backend PART 34

What's New in ASP.NET Core with .NET 8: Keyed DI, IExceptionHandler, Identity API and Native AOT

Keyed DI, IExceptionHandler, MapIdentityApi, ShortCircuit, TimeProvider, Native AOT and the minimal API template in .NET 8, compared with .NET 6, plus C# 12, migration notes and the November 10, 2026 end of support.

4 Nov 2026 9 min 41
Blog Map