3

I am trying to move from Structuremap 2.6.4.1 to 3.1.4.143 but am unable to figure out how to handle HybridHttpOrThreadLocalScoped. None of the SO Q/A I can find seems to work for me...

I have the following code:

using StructureMap;
using StructureMap.Web;

ObjectFactory.Configure( x =>
{
    x.For<IRepository<Person>>()
        .HybridHttpOrThreadLocalScoped() // Need the repo to survive for the duration of the thread!
        .Use<Repository_Stub<Person>>()
        .Ctor<IEnumerable<IEntity>>( "seed" ).Is( persons );
} );

that gives me this error:

'StructureMap.Configuration.DSL.Expressions.CreatePluginFamilyExpression<IRepository<Person>>' 
does not contain a definition for 'HybridHttpOrThreadLocalScoped' and no extension method
'HybridHttpOrThreadLocalScoped' accepting a first argument of type
StructureMap.Configuration.DSL.Expressions.CreatePluginFamilyExpression<IRepository<Person>>'
could be found (are you missing a using directive or an assembly reference?)

Is there a new way to invoke HybridHttpOrThreadLocalScoped?

Thansk in advance!

MatiasK
  • 686
  • 1
  • 7
  • 20

1 Answers1

5

HybridHttpOrThreadLocalScoped has been moved into a separate nuget package called Structuremap.Web.

It can be installed by running Install-Package structuremap.web in your Nuget Package Console. See this post for more information.

Community
  • 1
  • 1
Joseph Woodward
  • 9,191
  • 5
  • 44
  • 63