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); } }); } }
public void ConnectImplementationsToTypesClosing(Type openGenericType) { var convention = new GenericConnectionScanner(openGenericType); With(convention); }