我在ASP.NET MVC 5.x Web应用程序中使用结构图4.5.1 ,我执行扫描接口实现并为所有人添加The file will not be displayed in the editor because it is either binary, very large or uses an unsupported text encoding.
其中包含以下代码:
HybridHttpOrThreadLocalScoped()
public static class SmObjectFactory
{
private static readonly Lazy<StructureMap.Container> _containerBuilder =
new Lazy<StructureMap.Container>(DefaultContainer, LazyThreadSafetyMode.ExecutionAndPublication);
public static IContainer Container => _containerBuilder.Value;
private static StructureMap.Container DefaultContainer()
{
return new StructureMap.Container(config =>
{
config.Scan(scanner =>
{
scanner.AssemblyContainingType(typeof(IPostService));
scanner.WithDefaultConventions();
scanner.SingleImplementationsOfInterface()
.OnAddedPluginTypes(expression =>
expression.HybridHttpOrThreadLocalScoped());
});
});
}
}
它为固有HybridHttpOrThreadLocalScoped()
接口的所有接口添加了什么?如果答案是否定的,我怎么能这样做?IDisposable
?答案 0 :(得分:0)
HybridHttpOrThreadLocalScoped
只是一个life-time
说明符。因此,当您指定它时,它将用于所有请求和配置的实例,并且它在IDisposable
或不是MATCH (tg:Tag)<-[:TAGGED]-(tp:Testplan)
RETURN tg.tagName, count(DISTINCT tp.TP_MNEM) AS count ORDER by count DESC;
并不重要。它不是处理任何东西,而是一个终身指示器。