0
votes

In dapper I can get data with

Query<Person>("sql condition").

and I can do with dapper extensions

GetList<Person>(predicate) 

Both return an IEnumerable

Which approach should I choose for which situation?

As the extensions library is newer it seems to me that the author did not like building sql

conditions with strings. Instead I have a bit of intellisense and strong typing the

condition.

But is that all the advantage? Are there disadvantages you are aware of due to experience

in using both libraries?

1
GetList here - is that "rainbow"? Or your own custom method? (Dapper core doesn't have a GetList) - Marc Gravell
its dapper extensions and I have corrected my question. - Elisabeth

1 Answers

0
votes

The DapperExtension is there to help with the simple task of CRUD against a single table. If you need more then Query is the way to handle this. Admittedly SELECT is not as useful as it is a single table, but it has simplified many of the write operations.