The AddComponentInstance of:
WindsorContainer.Kernel.AddComponentInstance<T>(typeof(T), instance);
is obsolete.
It’s replacement is:
WindsorContainer.Register(Component.For<IClassParameters>().ImplementedBy<ClassParameters>());
However I have a facade:
public static void AddInstance<T>(object instance)
{
_iocManager.WindsorContainer.Kernel.AddComponentInstance<T>(typeof(T), instance);
}
I can’t see how to use the Register method instead of AddComponentInstance.
This is wrong:
_iocManager.WindsorContainer.Register(Component.For<T>().ImplementedBy<T>().Instance(instance));
What should I use?
The answer is:
Note the method signature forcing the compiler to take T as a Class and hence as a Ref variable