Is it possible to bind to a "get value" event for every property of a class of the domain model using nhibernate interceptors?
What i would like to do is:
- Have my domain model classes and mappings (nothing new here)
- Using a business layer to handle user requests. This layer should use transactions so a request would behave like this: requst -> open session and transaction -> fulfill request -> commit transaction and close session -> send results back (if any)
- User interacts with data through some kind of GUI. When he asks for some lazy loading data no LazyLoadException (or whatever its name is) is fired because an interceptor is registered and is capable of intercepting the read of a lazy load property. So it opens a nhibernate session and closes it when the read has been performed.
I hope you understand what i mean.
If you desperately need some code samples to clarify i'll try to provide even if i really don't know how to give a programmatic idea.
Any help would be very much appreciated, thanks!