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