Skip to content

Commit 37c9abb

Browse files
fixup! Clean-up IObjectsFactory usages
Rename the added interface
1 parent 4adf041 commit 37c9abb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/NHibernate.Test/ConnectionTest/CustomCurrentSessionTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void ContextIsSetup()
3737
}
3838
}
3939

40-
public class CustomContext : ICurrentSessionContextWithFactory
40+
public class CustomContext : ISessionFactoryAwareCurrentSessionContext
4141
{
4242
internal ISessionFactoryImplementor Factory;
4343
internal static ISession Session;

src/NHibernate/Context/ICurrentSessionContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace NHibernate.Context
1313
/// <list type="bullet">
1414
/// <item><description>contain a constructor accepting a single argument of type
1515
/// <see cref="ISessionFactoryImplementor" />, or implement
16-
/// <see cref="ICurrentSessionContextWithFactory"/></description></item>
16+
/// <see cref="ISessionFactoryAwareCurrentSessionContext"/></description></item>
1717
/// <item><description>should be thread safe</description></item>
1818
/// <item><description>should be fully serializable</description></item>
1919
/// </list>
@@ -49,7 +49,7 @@ public interface ICurrentSessionContext
4949
/// this interface allows the <see cref="IObjectsFactory"/> to be used for instantiating the
5050
/// session context.
5151
/// </summary>
52-
public interface ICurrentSessionContextWithFactory : ICurrentSessionContext
52+
public interface ISessionFactoryAwareCurrentSessionContext : ICurrentSessionContext
5353
{
5454
/// <summary>
5555
/// Sets the factory. This method should be called once after creating the context.

src/NHibernate/Impl/SessionFactoryImpl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,12 +1282,12 @@ private ICurrentSessionContext BuildCurrentSessionContext()
12821282
try
12831283
{
12841284
var implClass = ReflectHelper.ClassForName(impl);
1285-
if (!typeof(ICurrentSessionContextWithFactory).IsAssignableFrom(implClass))
1285+
if (!typeof(ISessionFactoryAwareCurrentSessionContext).IsAssignableFrom(implClass))
12861286
{
12871287
return (ICurrentSessionContext) Activator.CreateInstance(implClass, this);
12881288
}
12891289

1290-
var context = (ICurrentSessionContextWithFactory) Environment.ObjectsFactory.CreateInstance(implClass);
1290+
var context = (ISessionFactoryAwareCurrentSessionContext) Environment.ObjectsFactory.CreateInstance(implClass);
12911291
context.SetFactory(this);
12921292
return context;
12931293
}

0 commit comments

Comments
 (0)