I would like to know if there’s a good ORM that can automate some of the manual work I have to do right now. Our application uses stored procedures heavily, meaning that any interaction with the database goes through a stored procedure.
Right now, I have to call stored procedures in the traditional way, and it’s quite tedious. Is there an ORM that does a good job at dealing with stored procedures that:
- Have input/output parameters that are structured, meaning table valued types
- Easily allow for output parameters to be user-defined types, both scalar and table valued
- Return multiple record sets
Dapper has fairly extensive stored procedure support.
The trivial:
It can be mapped with the following.
Additionally you have support for:
So for example:
Can be mapped with:
Finally, Dapper also allows for a custom parameter implementation:
When implementing this interface you can tell Dapper what parameters you wish to add to your command. This allow you to support table-valued parameters and other database specific features.
You’re using it now on Stack Overflow…