Dapper class vs. dll?

asp.net-mvc-4 dapper

Question

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.

Accepted Answer

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.


Popular Answer

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.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why