Dapper Repository Implementation for Store Procedure Calls in .NET 8
Dapper is an open-source object-relational mapping (ORM) library for .NET and .NET Core applications. The library allows developers quickly and easily access data from databases without the need to write tedious code. Dapper allows you to execute raw SQL queries, map the results to objects, and execute stored procedures. In this article we will see the implementation of generic dapper repository to call the store procedures.
Dapper Repository Interface
Place this interface inside domain layer or in application layer.
Connection Factory Interface
Place this interface inside domain layer or in application layer beside your dapper repository interface. This connection factory is responsible for creating the connection with database
Implementation of Connection Factory Interface
Place this implementation inside your infrastructure project or maybe create a separate persistence project inside infrastructure and put this there.
Implementation of Dapper Repository
Place this implementation inside your infrastructure project or maybe create a separate persistence project inside infrastructure and put this there.







