开发者

Test In-Memory collection against NHibernate restrictions

开发者 https://www.devze.com 2023-02-13 09:09 出处:网络
My application allows a user to do some pretty in depth filter editing before they run a report. I have a whole framework to dynamically generate NHibernate restrictions based on these filters, and to

My application allows a user to do some pretty in depth filter editing before they run a report. I have a whole framework to dynamically generate NHibernate restrictions based on these filters, and to run the query.

I have a situation where I have one set of restrictions for the records I want to pull, and another set of restrictions to identify records within that set that should receive special processing.

Currently the best I can do is pull both sets from the database, and as I am processing the first set I must check if the second set contains the element to see if I need to apply my special processi开发者_运维技巧ng. The obvious problem here is that I must hit the database twice.

It would be much nicer if I could query an entity against a restriction without hitting the database. Does NHibernate have any facility for doing this?


Once you have an in-memory collection, why not use LINQ-to-objects?

0

精彩评论

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