1

Closed

[IOC] Support AutoFac as IoC container

description

Closed Oct 11, 2011 at 3:30 PM by GeertvanHorrik

comments

GeertvanHorrik wrote Oct 9, 2011 at 5:53 PM

Added nuget references to solution

GeertvanHorrik wrote Oct 11, 2011 at 3:30 PM

Cannot be supported, AutoFac does not support runtime registration of elements to existing containers.

credib wrote Oct 20, 2013 at 6:32 AM

It is wrong - sample code:

var updater = new ContainerBuilder();
updater.RegisterType<A>();
updater.Register(c => new B()).As<IB>();

// Add the registrations to the container
updater.Update(container);

GeertvanHorrik wrote Oct 20, 2013 at 2:25 PM

We are now working towards a better configurable support for external containers. The Catel 3.8 nightly releases now use the dependency resolver.

To implement Autofac, see the documentation: https://catelproject.atlassian.net/wiki/pages/viewpage.action?pageId=622682#IoC(ServiceLocatorandTypeFactory)-Replacingthedefaultcomponents