I have a question about implementing MVC IDependencyResolver.GetServices when using Unity for dependency injection.
There are several implementation examples, most of which were implemented to fix the Unity exception problem when trying to resolve unregistered types.
Usualy GetServices is implemented as follows:
IEnumerable<object> IDependencyResolver.GetServices(Type serviceType) { try { return _container.ResolveAll(serviceType); } catch { return new List<object>(); } }
What bothers me, and I could not find any confirmation in any case, is that ResolveAll does not return the standard (unnamed) registration. See here .
The documentation for IDependencyResolver does not make the same statement.
Does anyone know if IDependencyResolver.GetServices should return all registered instances or only named instances (using Unity parlance)?
source share