【发布时间】:2014-04-22 05:10:51
【问题描述】:
在以前版本的 StructureMap 中,我有这样的代码:
_container.Configure(config =>
config
.For<ILogger>.Use<TLogger>.Ctor<string>("loggerName")
.Is((IContext ctx) => ctx.Root.RequestedType.ToString))
使用它,我能够将类名传递给我的记录器,这在自动布线场景中非常有用。
更新到StructureMap 3后,上面的代码显示错误,我找不到适合StructureMap 3的代码。
TL;DR; Context.Root 在哪里?如何在 StructureMap 3 中访问它?
【问题讨论】:
标签: c# .net structuremap structuremap3