Which Structuremap v3 Lifecycle
is recommended to replace the old HybridLifecycle
? Specifically for a UnitOfWork
in a web app environment?
Asked
Active
Viewed 767 times
2

mxmissile
- 11,464
- 3
- 53
- 79
-
1Please be careful in using any lifestyle that has thread-afinity, such as `ThreadLocalScoped` or `HybridHttpOrThreadLocalScoped` as [explained here](https://stackoverflow.com/questions/14591422/why-is-perthreadlifetimemanager-used-in-this-example). – Steven Apr 18 '14 at 17:34
-
Currently using HttpContextLifecycle for my UOW. I assume that is preferred? – mxmissile Apr 18 '14 at 20:07
-
1HttpContext should not pose any trouble. – Steven Apr 18 '14 at 20:35
1 Answers
2
Add reference to StructureMap.Web Assembly.
Import these namespaces(they contain extension methods):
Imports StructureMap.Web
Imports StructureMap.Web.Pipeline
then you can use:
HybridHttpOrThreadLocalScoped

Afshin Gh
- 7,918
- 2
- 26
- 43
-
Didn't realize there was a separate library for the `Web` stuff. Thanks! – mxmissile Apr 18 '14 at 15:37