In StructureMap 2 I had something like this:
For<ILogger>().HybridHttpOrThreadLocalScoped().Use<Logger>();
When using Structure Map 3 should I use the following?
For<ILogger>().LifecycleIs<HybridLifecycle>().Use<Logger>();
Then I tried to apply the same change to:
For<IDispatcher>().Transient().Use<Dispatcher>();
And I wasn't able to use:
For<IDispatcher>().LifecycleIs<Transient>().Use<Dispatcher>();
Why?
Thank You, Miguel
First you need to install the new structuremap.web
package.
PM> install-package structuremap.web
Then add these namespaces to your class
using StructureMap;
using StructureMap.Web;
using StructureMap.Web.Pipeline;
Now you have access to the HybridHttpOrThreadLocalScoped()
as before.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With