2017-08-21 72 views

回答

0
Container.RegisterType<IAuthenticationService, AuthenticationService>(new ContainerControlledLifetimeManager()); 

这意味着AuthenticationService的寿命将容器的寿命相匹配。如果您不销毁并重新创建容器,您将始终获得相同的服务实例。

+0

谢谢,它的作品! –