tmsmith / Dapper-Extensions

Dapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Get, Insert, Update, Delete) for your POCOs. For more advanced querying scenarios, Dapper Extensions provides a predicate system. The goal of this library is to keep your POCOs pure by not requiring any attributes or base class inheritance.
1.79k stars 586 forks source link

Add Support for Stored Procedures to Get and GetList with Mapping #147

Open sam-changtum opened 7 years ago

sam-changtum commented 7 years ago

Where I work I have to deal with legacy (predecessor) databases containing quite a few stored procedures which are mostly used for querying the database. All of the result sets from these procedures return column names that have to be mapped to C# property names per C# coding standards/conventions.

I see that we can always drop to Dapper/Dapper.Contrib when I need to execute a stored procedure, but... that requires I also use a different mapping strategy via the [ColumnAtrribute] which does work and is wonderful. The ClassMapper is really attractive due to it moves the job of mapping table/column names away from the POCO.

Would there be enough interest in this becoming an enhancement for the Get and GetList operations?

I only see one other related issue here #127 which was closed on Oct 19, 2016.

pcbHikeME commented 7 years ago

I agree this would be appreciated

valfrid-ly commented 3 years ago

As it can be seen in the related issue is possible to use and DapperExtensions will map the result object. There is an example in the issue that was given by timdooling.

How a class, that is the base object for querying the database would identify when to use a StoredProcedure or using a select?

I believe any enhancement is welcome. Please, feel free to create the new methods and send the PR.