예제 #1
0
 public void ScanTypes(TypeSet types, IServiceCollection services)
 {
     if (_serviceType.IsOpenGeneric())
     {
         var scanner = new GenericConnectionScanner(_serviceType);
         scanner.ScanTypes(types, services);
     }
     else
     {
         types.FindTypes(TypeClassification.Concretes | TypeClassification.Closed).Where(Matches).Each(type =>
         {
             var serviceType = determineLeastSpecificButValidType(_serviceType, type);
             var instance    = services.AddType(serviceType, type);
             if (instance != null)
             {
                 instance.Name = _namePolicy(type);
             }
         });
     }
 }
예제 #2
0
        public void ConnectImplementationsToTypesClosing(Type openGenericType)
        {
            var convention = new GenericConnectionScanner(openGenericType);

            With(convention);
        }