Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dapper class vs. dll?

What are the pros/cons of copying Dapper.cs into my project vs. using the dll instead vs. installing the nuget package?

This is an MVC4 project if that matters.

like image 768
r.l.parker Avatar asked Aug 02 '26 17:08

r.l.parker


2 Answers

By copying in the Dapper.cs file you can directly edit your own instance of the file. This way would give you the most control over the functionality that Dapper gives you but you also run the risk of breaking it. This way also could be prone to errors with setting everything up to work correctly.

Installing the nuget package and using the dll are almost equivalent. In both cases you can access the functionality provided by Dapper.cs. This is the way the code is intended to be used. Installing the nuget package is probably your best bet because .Net automatically placing everything where it should be.

like image 168
jpniederer Avatar answered Aug 08 '26 20:08

jpniederer


I like to use Dapper.cs for debugging purposes. If something does not work as expected, or throws an error, I can quickly figure out the cause. At some point in the future, when I feel more comfortable with Dapper, I'm planning to switch to the using the DLL, or nuget package.

Also, having a source file allows you to make custom modifications to it.

like image 41
Void Ray Avatar answered Aug 08 '26 19:08

Void Ray