Its working fine, but i miss the comfortable LINQish style of writing predicates when filtering data.
So my question is, how can i translate a predicate in form of
Func<T, bool> to a SQL Server where clause to use it with dapper?
I think someone must have done this before, or are all the dapper users handcoding their sql statements?
As the title suggests, maybe it is an option to call the LINQ2SQL provider for SQL Server?
Basically i'm looking for something like the inverse of dynamic linq.
There are ways to see the SQL generated by LINQ. See the article Seeing the SQL Generated by LINQ to Entity Queries from Visual Studio Magazine.
Now that I understand better what you're after, I did a little more looking into this and found a couple of related posts that are worth a look:
Dynamic where clause in dapper which suggests using a Stringbuilder, but one of the comments points to a Sam Saffron article, Porting LINQ-2-SQL to Dapper for great justice, that talks about a contributed SqlBuilder that might help you.
Generate a SQL clause using a Linq-to-Sql Expression which suggests using a LINQ Where call and grabbing the WHERE clause from the generated SQL.