Uses IScopeContext which wraps either HttpContext or CallContext which is created/injected via IOC factory.
16 lines
408 B
C#
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();
|
|
}
|
|
}
|
|
} |