Why not, but as this implies a change in the ISession/IStatelessSession 
interfaces (any change in an interface is binary breaking, even just adding 
things), it could be merged only in 6.0, unless done via extension methods 
instead at first.
About disposing things which have been supplied to the session by users, I 
dislike the idea. It may not be right for all use cases. Better leave that 
to who has created them.

Le dimanche 16 décembre 2018 18:11:16 UTC+1, Germán Schuager a écrit :
>
> Thanks for the tip! I'm already ensuring that things get cleaned up 
> correctly, but ConditionalWeakTable seems to better fit this use case, I 
> didn't know about it.
>
> Would this feature be something worth adding to NH? Maybe even disposing 
> IDisposable items on session dispose. Would you accept a PR?
>
>
> El dom., 16 de dic. de 2018 a la(s) 12:16, Gunnar Liljas (
> [email protected] <javascript:>) escribió:
>
>> Hi,
>>
>> There are indeed cases where such a thing would be nice, but currently
>> there is no such thing. What you're already doing is probably the best
>> workaround, but I would use WeakReferences or a ConditionalWeakTable,
>> so that the dictionary doesn't hold references to discarded sessions.
>>
>> /G
>>
>> Den sön 16 dec. 2018 kl 15:42 skrev Germán Schuager <[email protected] 
>> <javascript:>>:
>> >
>> > Hi, I often have the requirement to store session related stuff known 
>> at session creation that need to be used at some other point in time (for 
>> example in event listeners, which are singletons).
>> > I solved this case in some places using basically a 
>> Dictionary<ISession, SessionContext> (SessionContext is another 
>> dictionary), but always thought that it would be very useful if ISession 
>> would already contain an Items bag for example... is there anything like 
>> that?
>> >
>> > --
>> > You received this message because you are subscribed to the Google 
>> Groups "nhusers" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to [email protected] <javascript:>.
>> > To post to this group, send email to [email protected] 
>> <javascript:>.
>> > Visit this group at https://groups.google.com/group/nhusers.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "nhusers" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/nhusers/fySOrgnCynU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/nhusers.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to