Question

I use the specification pattern to dynamically generate LINQ expressions, which will be used

  1. On entities in memory
  2. 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.

Was it helpful?

Solution

There is currently no way to directly influence the generation of the SQL per API. However, what you could do is to break the entire expression tree into a server side executed and a client side executed part manually by performing .ToList() between the parts. Alternativly you could see the Telerik Support with the query that you need to achieve and the source LINQ + model.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top