Files
Umbraco-CMS/src/Umbraco.Core/DefaultScopeContextFactory.cs
Shannon bd31dd6caf Fixes issue with ThreadStatic db
Uses IScopeContext which wraps either HttpContext or CallContext which is created/injected via IOC factory.
2016-04-29 17:08:34 +02:00

16 lines
408 B
C#

using System.Web;
using Umbraco.Core.Persistence;
namespace Umbraco.Core
{
/// <summary>
/// Default scope context factory
/// </summary>
internal class DefaultScopeContextFactory : IScopeContextFactory
{
public IScopeContext GetContext()
{
return HttpContext.Current == null ? (IScopeContext)new CallContextScope() : new HttpContextScope();
}
}
}