6

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

Miguel Moura
  • 36,732
  • 85
  • 259
  • 481

1 Answers1

8

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.

VahidN
  • 18,457
  • 8
  • 73
  • 117