public static ActorSystem UseDryIoC(this ActorSystem system, IContainer container, out IDependencyResolver dependencyResolver) { if (container == null) { throw new ArgumentNullException(nameof(container)); } dependencyResolver = new DryIocDependencyResolver(container, system); return(system); }
public static void Register(HttpConfiguration config) { var adapter = new DryIocAdapter(); var binders = new IBinding[] { new BusinessBinder(), new DaoBinder(), new SharedBinder(), new IoCFrameworkBinder(), }; foreach (var binder in binders) { binder.SetBinding(adapter); } var containerWithMvc = adapter._container.WithMvc(); var ioc = new DryIocDependencyResolver(containerWithMvc); DependencyResolver.SetResolver(ioc); }