简体   繁体   中英

Castle Windsor lifestyle for web-service

Let us suppose we are injecting instances of web-services via Castle Windsor. What is the scenario when I want to use Transient lifestyle for them or PerWebRequest one? What is the way to think? Thanks

If you want a new instance of a component every time you request one from the container, use Transient. If you want the same instance to be pulled from the container throughout the life of a single web request, use PerWebRequest.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM