Mert Özen Further With Every Line

Blog

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

Series
19 posts found #dapper
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 9
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 12
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 12
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 7
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 13
EF Core and Architecture: Repositories, the Read Side of CQRS and Moving to Dapper
Database PART 23

EF Core and Architecture: Repositories, the Read Side of CQRS and Moving to Dapper

With real SQL we see how a generic repository silently moves the WHERE into memory, and discuss DbContext already being a unit of work. We finish the core block with an aggregate-specific repository, projections on the CQRS read side and Dapper sharing the same connection and transaction.

5 Nov 2026 10 min 25
What Is Entity Framework Core? The ORM Idea and EF Core's Architecture
Database PART 01

What Is Entity Framework Core? The ORM Idea and EF Core's Architecture

Starting from plain ADO.NET code we see why ORMs exist: EF Core's DbContext, model, provider and change tracker, the different SQL SQLite and SQL Server generate from the same LINQ, EF6 versus EF Core, a Dapper comparison and how the series is organized.

5 Nov 2026 9 min 20
Blog Map