How does Dapper work

My question is not exactly related to how the workflow of Dapper works but rather how it's extension methods work I recently got into partial classes and extension methods and I was wondering how Dapper is able to add a Query<T>() function into all sorts of SQL connectors, wouldn't that mean Dapper would need to link every single SQL connector as a dependency in order to target to the object to extend on? Because I would like to make an extension library based on another project I once made but I don't want to end up linking a version of my library into it that is a dependency which eventually becomes outdated while nothing on its extending part changes simply because the linked dependency is not up to date anymore
5 Replies
Jimmacle
Jimmacle2mo ago
the extension methods are on the general IDbConnection interface, not the specific provider classes
Somgör from Human Resources
So it's extending an interface that all sql packages use?
Jimmacle
Jimmacle2mo ago
yes
Jimmacle
Jimmacle2mo ago
GitHub
Dapper/Dapper/SqlMapper.Async.cs at main · DapperLib/Dapper
Dapper - a simple object mapper for .Net. Contribute to DapperLib/Dapper development by creating an account on GitHub.
Want results from more Discord servers?
Add your server
More Posts