Пример #1
0
 public ServiceKey(Type serviceType, ServiceDefinition definition)
 {
     ServiceType   = serviceType;
     ImplementType = definition.GetImplementType();
 }
Пример #2
0
        public IServiceContainer Add(ServiceDefinition item)
        {
            if (_disposed)
            {
                throw new InvalidOperationException("the service container had been disposed");
            }
            if (_services.Any(_ => _.ServiceType == item.ServiceType && _.GetImplementType() == item.GetImplementType()))
            {
                return(this);
            }

            _services.Add(item);
            return(this);
        }
Пример #3
0
        public IServiceContainerBuilder Add(ServiceDefinition item)
        {
            if (_services.Any(_ => _.ServiceType == item.ServiceType && _.GetImplementType() == item.GetImplementType()))
            {
                return(this);
            }

            _services.Add(item);
            return(this);
        }