I have a ServiceStack API application which uses Simple Injector as its IoC container. I need certain components to have a 'per web request' lifestyle.
I looked up in the Simple Injector documentation here, and found that it has not one, but two lifestyles corresponding to 'per web request':
- Per Web Request
- Per Web API Request
This confused the hell out of me because I always thought all ASP.NET applications used the same basic pipeline, and that IoC containers implemented per web request by plugging in an HTTP module. Why would this be different for Web API applications?
Can anyone shed some light about which is most appropriate for a ServiceStack API application?