2

Which Structuremap v3 Lifecycle is recommended to replace the old HybridLifecycle? Specifically for a UnitOfWork in a web app environment?

mxmissile
  • 11,464
  • 3
  • 53
  • 79
  • 1
    Please 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
  • 1
    HttpContext should not pose any trouble. – Steven Apr 18 '14 at 20:35

1 Answers1

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