2012-03-16 57 views
0

我想能夠做到以下類型註冊與團結,有誰知道如何?我該如何進行以下與Unity IoC的NInject註冊?

Bind<ILogger>().To<AssemblyEditorLogger>() 
    .WithConstructorArgument("currentClassName", 
          x => x.Request.ParentContext != null ? 
          x.Request.ParentContext.Request.Service.FullName : typeof (BootStrapper).FullName); 

基本上在Unity我如何才能獲得我們正在創建的實例類的類型 - 我使用構造器注入。

回答

1

與此相關question

您可以使用與LogManager.GetLogger()相同的方式訪問該類型。

相關問題