Reputation: 25651
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.
Upvotes: 0
Views: 414
Reputation: 6806
Related to this question.
You can get access to the type the same way it is done for LogManager.GetLogger()
.
Upvotes: 1