/// <summary> /// Registers all controller types from the given assemblies. /// </summary> /// <param name="map">The target dependency map.</param> /// <param name="assemblies">The list of assemblies that contain the controller types being registered.</param> public static void RegisterAllControllersFrom(this DependencyMap map, IEnumerable <Assembly> assemblies) { Action <DependencyMap, Type> registerTypeAction = (dependencyMap, controllerType) => { var typeName = controllerType.Name; dependencyMap.AddService(typeName, typeof(IController), controllerType); }; map.AddServicesFrom(assemblies, TypeFilters.IsDerivedFrom <IController>(), registerTypeAction); }