dapper

Write read-optimized SQL queries with Dapper and EF Core.

4|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill dapper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dapper
Source: https://github.com/FaysilAlshareef/dotnet-ai-kit/tree/main/skills/data/dapper
Command: npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill dapper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Dapper provides a lightweight, high-performance alternative to EF Core for read-heavy operations where complex joins, multi-mapping, or reporting queries cause EF Core to be inefficient or overly verbose.

Core Features & Use Cases

  • Efficient read queries: Execute parameterized SQL for single-row lookups, lists, and aggregates with minimal overhead.
  • Multi-mapping and joins: Map joined results into DTO graphs for orders with items or other parent-child shapes.
  • Pagination and dynamic filtering: Build performant paginated queries using SqlBuilder and parameter binding.
  • Integration patterns: Use an IDbConnectionFactory and DI registration to coexist with EF Core for writes while Dapper handles reads.

Quick Start

Use the dapper skill to implement a read-optimized query that returns paginated order summaries with dynamic filtering and multi-mapping.

Frequently Asked Questions about dapper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize complex SQL joins for read-heavy operations in .NET?

Dapper executes read-optimized SQL queries alongside EF Core for complex joins and reporting. It maps joined results into DTO graphs for parent-child shapes like orders with items, avoiding EF Core inefficiencies and verbosity in heavy read operations.

How do I implement pagination and dynamic filtering with Dapper?

Implement pagination and dynamic filtering with Dapper by using Dapper.SqlBuilder to construct performant paginated queries. SqlBuilder enables dynamic parameter binding for filtering conditions while maintaining parameterized CommandDefinition usage for safe query execution.

Can I use Dapper alongside EF Core in the same .NET project?

Yes, you can use Dapper alongside EF Core in the same .NET project by implementing an IDbConnectionFactory. This integration pattern allows EF Core to handle writes while Dapper manages high-performance read operations for complex joins and reporting.

What dependencies do I need to set up Dapper for read queries?

To set up Dapper for read queries, you need Dapper and Dapper.SqlBuilder NuGet packages, an IDbConnectionFactory for DI registration, and CancellationToken-aware query execution using parameterized CommandDefinition objects for safe asynchronous operations.

When should I choose Dapper over EF Core for database queries?

Choose Dapper over EF Core for database queries when you need high-performance read operations involving complex joins, multi-mapping, or reporting. Dapper provides a lightweight alternative to EF Core where read-heavy operations cause EF Core to be inefficient or overly verbose.