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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top