I have an IIS hosted WCF service with single-call behavior. I use Fluent NH for data access and faced the following issue. I cannot close/dispose NH session inside of method body because when serialization comes to the game it cannot access lazy loaded fields. I tried to use approach described in answer for this question NHibernate session management in WCF application but it turns their session disposal also happens before serialization starts.
Do you know if I can execute any code in instance context after serialization is finished?
Thanks