NHibernate ISession in ASP.NET Core: DI scope vs CurrentSessionContext — which should own the session?
I'm integrating NHibernate 5.4 with ASP.NET Core 8 and need to decide how the ISession lifecycle should be managed. NHibernate's built-in CurrentSessionContext implementations (web, call) predate ASP.NET Core's middleware pipeline and IServiceScope model, so the two boundaries don't line up cleanly. The community NHibernate.AspNetCore package registers ISess