예제 #1
0
        public IContainerBuilder AddStatic <TService>()
        {
            var serviceType = typeof(TService);

            _descriptionMap[serviceType] = new StaticServiceDescriptor(this, serviceType, serviceType, null);
            return(this);
        }
예제 #2
0
        public IContainerBuilder AddStatic <TService>(Func <Abstractions.IServiceProvider, TService> implementationFactory) where TService : class
        {
            var serviceType = typeof(TService);

            _descriptionMap[serviceType] = new StaticServiceDescriptor(this, serviceType, serviceType, implementationFactory);
            return(this);
        }
예제 #3
0
        public IContainerBuilder AddStatic <TService, TImplementation>()
            where TImplementation : class, TService
        {
            var serviceType = typeof(TService);

            _descriptionMap[serviceType] = new StaticServiceDescriptor(this, serviceType, typeof(TImplementation), null);
            return(this);
        }