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