Since my previous post I've rewritten the internals to make use of LinqKit - a fantastic lightweight project.
See the changes
I took my rewrite as an opportunity to support the full query syntax:
and added easy support for compiled queries (currently only supporting linq to objects and linq to sql):
I've also optimized the expression parsing (speed difference is negligible to normal queries), and I tweaked the QueryProperty construction:
The big change here is that I've added an extra parameter; a reference back to the mapping property.
I'd really like a memberof(Loan.IsOverdue) keyword style syntax in C#, but since there's not, I use this expression to grab the MemberInfo - which is used in the expression parser.
It's a slight DRY drawback, but it's a faster way than using reflection (and avoids an ugly string lookup) - and it's much faster than using attributes.
Get the code
Most of the big changes are all implementation specific, so be sure to check out the sample app.
Please let me know what you think!
BTW: Joseph, I made some architectural changes to the LinqKit.ExpandableQuery stuff. Externally it behaves exactly the same, but it now lets me reuse a lot more code.
It's light on the comments, but I'm hoping my next post will explain myself.
ed: Continue to Part III