Skip to content

Commit 79b5c5a

Browse files
fixup! Replace IObjectsFactory with IServiceProvider interface
Fix regression: must use GetService instead of GetInstance for ICurrentSessionContext, since it is optional and GetInstance does not support it.
1 parent 131830b commit 79b5c5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NHibernate/Impl/SessionFactoryImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ private ICurrentSessionContext BuildCurrentSessionContext()
12901290
}
12911291
else
12921292
{
1293-
context = (ICurrentSessionContext) Environment.ServiceProvider.GetInstance(
1293+
context = (ICurrentSessionContext) Environment.ServiceProvider.GetService(
12941294
implClass ?? typeof(ICurrentSessionContext));
12951295
}
12961296
if (context is ISessionFactoryAwareCurrentSessionContext sessionFactoryAwareContext)

0 commit comments

Comments
 (0)