Yurii Hohan
Yurii Hohan

Reputation: 4171

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

Upvotes: 1

Views: 505

Answers (1)

Isaac Overacker
Isaac Overacker

Reputation: 1535

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.

Upvotes: 1

Related Questions