AwkwardCoder
AwkwardCoder

Reputation: 25651

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.

Upvotes: 0

Views: 414

Answers (1)

Sebastian Weber
Sebastian Weber

Reputation: 6806

Related to this question.

You can get access to the type the same way it is done for LogManager.GetLogger().

Upvotes: 1

Related Questions