Skip to content

Commit 5643186

Browse files
ngbrownhazzik
authored andcommitted
NH-3807 - Guard on uses of HttpContext since CoreCli doesn't have it.
1 parent a91ddbe commit 5643186

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
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: 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 NHibernate.Engine;
@@ -25,4 +27,6 @@ protected override void SetMap(IDictionary value)
2527
ReflectiveHttpContext.HttpContextCurrentItems[SessionFactoryMapKey] = value;
2628
}
2729
}
28-
}
30+
}
31+
32+
#endif

src/NHibernate/Impl/SessionFactoryImpl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,8 +1258,10 @@ private ICurrentSessionContext BuildCurrentSessionContext()
12581258
#endif
12591259
case "thread_static":
12601260
return new ThreadStaticSessionContext(this);
1261+
#if FEATURE_WEB_SESSION_CONTEXT
12611262
case "web":
12621263
return new WebSessionContext(this);
1264+
#endif
12631265
#if FEATURE_REMOTING
12641266
case "wcf_operation":
12651267
return new WcfOperationSessionContext(this);

0 commit comments

Comments
 (0)