I use the specification pattern to dynamically generate LINQ expressions, which will be used
- On entities in memory
- For SQL code generation by OpenAccess
See this blog post for an example of what I'm trying to achieve.
It all works fine so far, except that I would like to somehow
override the SQL that OpenAccess generates for one particular
specification (which could turn up anywhere in the generated expression
tree). All the rest is fine, which is why I would like to avoid writing
my own translator.
Something as simple as running a RegEx replacement over the complete SQL string just before it's sent to the server would be sufficient, but I just can't find a way...