-
Notifications
You must be signed in to change notification settings - Fork 3
Home
I know that inline SQL is a divisive topic. I love and use Linq to objects often, but have never enjoyed Linq to Entities because I don't like how it handles dynamic criteria, its strange outer join syntax, and the complications around debugging and working with generated SQL.
At the same time, it's true that thoughtless use of inline SQL makes application code brittle and complicated. With this in mind, I created Dapper.QX as both a productivity layer and a testing framework for inline SQL. I based it on Dapper since it handles low-level query execution and mapping of results to CLR types really well.
Productivity in query applications means having a good way to handle dynamic predicates as well as ending up with readable code. Dapper.QX lets you mix and match criteria in a type-safe and concise syntax using ordinary C# object literals. Dapper.QX does not use lambdas nor generate any SQL apart from using AND
to join the terms of your WHERE clauses. This way, you can:
- Use any SQL feature supported by your platform. Dapper.QX is platform-neutral because Dapper is.
- Not be surprised by mysterious generated SQL nor be limited to expressions that support Linq translation
- Write code that conveys intent in a way that a screenful of SQL does not.
Query
classes have a single responsibility, and can be executed from a single statement.
Dapper.QX is a refresh and rebranding of part of my Postulate project. Dapper.QX is an all new implementation, but probably 99% code-compatible with Postulate, and the old documentation still applies. I'll be updating the Wiki here with all the old info as necessary.