When should Dapper be used instead of ADO.NET?
I would like to understand the pros and cons of Dapper over ADO.NET. What are the advantages of Dapper that would motivate its use?
When should Dapper be used instead of ADO.NET?
I would like to understand the pros and cons of Dapper over ADO.NET. What are the advantages of Dapper that would motivate its use?
Dapper is just a tool. What it does is:
What it doesn't do is:
SubmitChanges()
(or whatever)The raw dapper library doesn't provide CRUD features, but the "contrib" additional package does provide basic CRUD.
Basically, it isn't a full-weight ORM, but if you just want to run queries without having to fight an ORM, or pay the overheads associated with an ORM, it is pretty great. If you don't know SQL, the raw library probably isn't for you ("contrib" should be fine, though), but lots of people not only know SQL, but they want to be in control of the SQL (rather than letting the ORM come up with some interpretation of your intent that has not been optimized, etc).
To summarize, reasons might be:
As for "vs ADO.NET":
SqlGeometry
data), those are not directly availalbe in dapper - you'd need to implement an interface to tell it how to handle your scenario, but that isn't hard (note that the specific SqlGeometry
example is handled by an additional dapper library)DataTable
:) –
Overtrick © 2022 - 2024 — McMap. All rights reserved.