[英]How would I do the following NInject registration with Unity IoC?
I want to be able to do the following type registration with unity, does anyone know how? 我希望能够统一进行以下类型注册,有人知道吗?
Bind<ILogger>().To<AssemblyEditorLogger>()
.WithConstructorArgument("currentClassName",
x => x.Request.ParentContext != null ?
x.Request.ParentContext.Request.Service.FullName : typeof (BootStrapper).FullName);
Basically in Unity how do I get access to the type of class we are creating the instance for - I am using constructor injection. 基本上在Unity中,我如何访问要为其创建实例的类的类型-我正在使用构造函数注入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.