I am trying to implement a soft-deleted repository. This can usually be easily done using the "Delete Event" listener. To filter out deleted objects, I can add the Where attribute to map classes. However, I also need to implement two more methods in the repository for this object: Restore and Clear . Restore will "restore" entities, and Purge will delete them. This means that I cannot use the Where attribute (since it blocks objects with soft deletes for any access)
I tried to use filters . I can create a filter and enable or disable it in a session to achieve the same result. But the problem with the filters does not affect the Session.Get method (they only affect access based on ICriteria).
Any ideas on how to solve this problem?
thanks
Khash
source share