Beispiel #1
0
        public object ResolveComponent(Service service)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            if (!registrations.ContainsKey(service))
            {
                throw new DependencyResolutionException($"Cannot find registration: {service}");
            }

            ComponentRegistration componentRegistration = registrations[service];

            return(componentRegistration.Activator(this));
        }