views:

403

answers:

1

I'm trying to implement a Soft-deletable repository. Usually this can be easily done with a Delete Event listener. To filter out the deleted entities, I can add a Where attribute to my class mapping. However, I also need to implement two more methods in the repository for this entity: Restore and Purge. Restore will "undelete" entities and Purge will hard-delete them. This means I can't use Where attribute (since it block out soft-deleted entities to any access)

I tried using filters instead. I can create a filter and enable or disable it within session to achieve the same result. But the problem is filters don't have any effect on Session.Get method (they only affect ICriteria based access).

Any ideas as to how solve this problem?

Thanks

A: 

did you ever find a solution for this?

kmoo01
Nope. Filters don't work on Get. They only affect criteria. I had to implement a different approach on the base repository only for Get and let Filter handle the other use cases.
Khash