2
我知道,你可以添加註冊一個LifetimeScope
當是這樣創建的:是否可以在Autofac LifetimeScope創建後添加註冊?
using(var scope = container.BeginLifetimeScope(builder =>
{ builder.RegisterType<Override>().As<IService>();
builder.RegisterModule<MyModule>();
}))
{
// The additional registrations will be available
// only in this lifetime scope.
}
是否有可能的LifetimeScope
之後添加註冊創建? (添加註冊的using
塊例如內)
你能描述你想要做什麼? –