开发者

How to find which Expression(s) matched in a linq query

开发者 https://www.devze.com 2023-04-03 15:44 出处:网络
I have a set of expressions saved in a database table. The requirement is to match a bunch of these expressions against a Linq (to Entities) query. For performance sake I am combining the expressions

I have a set of expressions saved in a database table. The requirement is to match a bunch of these expressions against a Linq (to Entities) query. For performance sake I am combining the expressions with an OR clause so I can run the query just once instead of running the same query for each expression one by one. Is there a way to find out out which of the开发者_开发知识库 expressions really matched against the query?

Thanks A


Not really. The only way is evaluate each response separately, and then once you have all the resultsets, union them in LINQ.

It's really not easy to do in the database either, at least I 'm pretty sure.

HTH.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号