Skip to content

Commit 8e42ee4

Browse files
committed
NH-3807 - Guard on uses of HttpContext since CoreCli doesn't have it.
1 parent 6f22b8f commit 8e42ee4

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/NHibernate/Context/ReflectiveHttpContext.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if FEATURE_WEB_SESSION_CONTEXT
2+
13
using System;
24
using System.Collections;
35
using System.Linq.Expressions;
@@ -54,4 +56,6 @@ private static void CreateHttpContextItemsGetter()
5456
HttpContextItemsGetter = (Func<object, IDictionary>) Expression.Lambda(itemsProperty, contextParam).Compile();
5557
}
5658
}
57-
}
59+
}
60+
61+
#endif

src/NHibernate/Context/WebSessionContext.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if FEATURE_WEB_SESSION_CONTEXT
2+
13
using System;
24
using System.Collections.Generic;
35
using NHibernate.Engine;
@@ -26,3 +28,5 @@ protected override void SetMap(IDictionary<ISessionFactoryImplementor, ISession>
2628
}
2729
}
2830
}
31+
32+
#endif

src/NHibernate/Impl/SessionFactoryImpl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,10 @@ private ICurrentSessionContext BuildCurrentSessionContext()
12541254
#endif
12551255
case "thread_static":
12561256
return new ThreadStaticSessionContext(this);
1257+
#if FEATURE_WEB_SESSION_CONTEXT
12571258
case "web":
12581259
return new WebSessionContext(this);
1260+
#endif
12591261
#if FEATURE_REMOTING
12601262
case "wcf_operation":
12611263
return new WcfOperationSessionContext(this);

0 commit comments

Comments
 (0)