dapper GetList(predicate) vs Query(sql condition)

dapper dapper-extensions

Question

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?

Popular Answer

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.



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow