mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Adapting WorkContextAccessor resolution
--HG-- branch : 1.x
This commit is contained in:
@@ -7,12 +7,13 @@ using Autofac;
|
||||
using Autofac.Builder;
|
||||
using Autofac.Core;
|
||||
using Autofac.Features.Metadata;
|
||||
using Orchard.Mvc;
|
||||
using Module = Autofac.Module;
|
||||
|
||||
namespace Orchard.Environment {
|
||||
public class WorkContextModule : Module {
|
||||
protected override void Load(ContainerBuilder builder) {
|
||||
builder.RegisterType<WorkContextAccessor>()
|
||||
builder.Register(ctx => new WorkContextAccessor(ctx.Resolve<IHttpContextAccessor>(), ctx.Resolve<ILifetimeScope>()))
|
||||
.As<IWorkContextAccessor>()
|
||||
.InstancePerMatchingLifetimeScope("shell");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user