mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-20 19:03:25 +08:00
Removed erroneous HttpContextBase registrations
This commit is contained in:
@@ -6,7 +6,6 @@ using System.Web;
|
|||||||
using Autofac;
|
using Autofac;
|
||||||
using Autofac.Builder;
|
using Autofac.Builder;
|
||||||
using Autofac.Core;
|
using Autofac.Core;
|
||||||
using Autofac.Features.Metadata;
|
|
||||||
using Module = Autofac.Module;
|
using Module = Autofac.Module;
|
||||||
|
|
||||||
namespace Orchard.Environment {
|
namespace Orchard.Environment {
|
||||||
@@ -24,10 +23,6 @@ namespace Orchard.Environment {
|
|||||||
.As<WorkContextProperty<HttpContextBase>>()
|
.As<WorkContextProperty<HttpContextBase>>()
|
||||||
.InstancePerMatchingLifetimeScope("work");
|
.InstancePerMatchingLifetimeScope("work");
|
||||||
|
|
||||||
builder.Register(ctx => ctx.Resolve<WorkContextProperty<HttpContextBase>>().Value)
|
|
||||||
.As<HttpContextBase>()
|
|
||||||
.InstancePerDependency();
|
|
||||||
|
|
||||||
builder.RegisterGeneric(typeof(WorkValues<>))
|
builder.RegisterGeneric(typeof(WorkValues<>))
|
||||||
.InstancePerMatchingLifetimeScope("work");
|
.InstancePerMatchingLifetimeScope("work");
|
||||||
|
|
||||||
|
@@ -52,11 +52,6 @@ namespace Orchard.Mvc {
|
|||||||
var baseUrl = new Func<string>(() => siteService.GetSiteSettings().BaseUrl);
|
var baseUrl = new Func<string>(() => siteService.GetSiteSettings().BaseUrl);
|
||||||
var httpContextBase = new HttpContextPlaceholder(baseUrl);
|
var httpContextBase = new HttpContextPlaceholder(baseUrl);
|
||||||
|
|
||||||
if (httpContextBase == null) {
|
|
||||||
context.Resolve<IWorkContextAccessor>().CreateWorkContextScope();
|
|
||||||
return context.Resolve<IHttpContextAccessor>().Current();
|
|
||||||
}
|
|
||||||
|
|
||||||
context.Resolve<IWorkContextAccessor>().CreateWorkContextScope(httpContextBase);
|
context.Resolve<IWorkContextAccessor>().CreateWorkContextScope(httpContextBase);
|
||||||
return httpContextBase;
|
return httpContextBase;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user