我正在尝试从 Structuremap 2.6.4.1 迁移到 3.1.4.143,但无法弄清楚如何处理 HybridHttpOrThreadLocalScoped。没有一个 SO Q/AI 可以找到似乎对我有用......
我有以下代码:
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 );
} );
这给了我这个错误:
'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?)
是否有调用 HybridHttpOrThreadLocalScoped 的新方法?
提前谢谢!