How to access overall AutoFac container to register a dependency in Orchard?

前端 未结 1 1740
鱼传尺愫
鱼传尺愫 2021-01-18 19:16

the question is pretty straightforward.i want to access overall AutoFac container so that i can register my dependency in it.

remark:

1条回答
  •  被撕碎了的回忆
    2021-01-18 19:46

    You can add an Autofac module directly to your Orchard module and Orchard will pick it up. ex...

    public class MyModule : Module {
       protected override void Load(ContainerBuilder builder){
          builder.RegisterType().As().InstancePerDependency();
       }
    }
    

    0 讨论(0)
提交回复
热议问题