示例#1
0
        public ILifetime ImplementedBy <TImplementation>()
            where TImplementation : TService
        {
            var implementedByRegistration = new ComponentImplementedByRegistration <TService, TImplementation>(_serviceTypes);

            _register = implementedByRegistration;
            return(implementedByRegistration);
        }
示例#2
0
        public void Register(IServiceCollection services)
        {
            var filteredTypes = FilteredTypes;

            foreach (var type in filteredTypes)
            {
                var serviceTypes            = _serviceTypeSelector.GetServicesFor(type);
                var serviceLifetimeSelector = _serviceTypeSelector.GetLifetimeSelector();

                var componentRegistration = new ComponentImplementedByRegistration <object, object>(serviceTypes, type, serviceLifetimeSelector);
                componentRegistration.Register(services);
            }
        }