repository-dapper

Implement a Dapper-based repository against a generic IRepository<T> interface.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/congiuluc/my-awesome-copilot --skill repository-dapper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: repository-dapper
Source: https://github.com/congiuluc/my-awesome-copilot/tree/main/skills/repository-dapper
Command: npx skills add https://github.com/congiuluc/my-awesome-copilot --skill repository-dapper

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Simplifies data access by implementing a reusable Dapper-based repository pattern against a generic IRepository<T> interface, reducing boilerplate and improving testability.

Core Features & Use Cases

  • Dapper-based repository implementation for CRUD against domain entities.
  • Supports raw SQL, stored procedures, multi-mapping, and bulk operations.
  • DI-friendly wiring and sample usage with a sample domain model.
  • References and patterns for advanced querying and migrations in the sample.

Quick Start

Follow the sample in samples/repository-dapper-sample.cs to implement the Dapper repository and DI wiring.

Frequently Asked Questions about repository-dapper

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

FAQPage Schema
How do I implement a Dapper repository pattern in .NET to reduce boilerplate?

Implement a Dapper-based repository against a generic IRepository<T> interface to reduce boilerplate. It enforces parameterized queries and uses an IDbConnectionFactory, ensuring your data access remains fast and testable.

Does the Dapper repository pattern support multi-mapping and stored procedures?

Yes, the Dapper repository pattern supports multi-mapping and stored procedures. It provides read-optimized raw SQL support for CRUD operations across SQL Server, PostgreSQL, and SQLite.

What is the best way to make Dapper data access testable in C#?

The best way to make Dapper data access testable is using an IDbConnectionFactory for dependency injection. This decouples database connections from repository logic, allowing you to mock connections during unit testing.

Can I use this Dapper repository with PostgreSQL and SQLite databases?

Yes, you can use this Dapper repository with PostgreSQL and SQLite databases. It is applicable to .NET applications requiring fast queries and supports SQL Server, PostgreSQL, and SQLite.

How do I wire up Dapper repositories with dependency injection in .NET?

You wire up Dapper repositories using DI-friendly registration provided in the sample usage. The implementation includes dependency injection wiring and a sample domain model to streamline setup in your .NET applications.

When should I choose a Dapper repository over other ORM approaches in C#?

Choose a Dapper repository when you need fast, read-optimized queries with raw SQL support in C#. It is ideal for .NET applications requiring multi-mapping and stored procedures without the overhead of heavier ORMs.