public void ScanTypes(TypeSet types, Registry registry)
 {
     foreach (var type in types.AllTypes())
     {
         registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());
     }
 }
 public void ScanTypes(TypeSet types, Registry registry)
 {
     foreach (var type in types.AllTypes())
     {
         Process(type, registry);
     }
 }
예제 #3
0
 public void ScanTypes(TypeSet types, Registry registry)
 {
     foreach (var type in types.AllTypes())
     {
         if (type.CanBeCastTo<Controller>() && !type.IsAbstract)
         {
             registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());
         }
     }
 }
예제 #4
0
 public void ScanTypes(TypeSet types, Registry registry)
 {
     types.AllTypes().ToList().ForEach(type =>
     {
         if (type.CanBeCastTo<Controller>() && !type.IsAbstract)
         {
             registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());
         }
     });
 }
        public override void ScanTypes(TypeSet types, Registry registry)
        {
            types.AllTypes().Each(type =>
            {
                IEnumerable<Type> interfaceTypes = type.FindInterfacesThatClose(_openType);
                if (!interfaceTypes.Any()) return;

                if (type.IsConcrete())
                {
                    _concretions.Add(type);
                }

                foreach (Type interfaceType in interfaceTypes)
                {
                    _interfaces.Fill(interfaceType);
                }
            });



            _interfaces.Each(@interface =>
            {
                var expression = registry.For(@interface);
                ConfigureFamily(expression);

                var exactMatches = _concretions.Where(x => x.CanBeCastTo(@interface)).ToArray();
                if (exactMatches.Length == 1)
                {
                    expression.Use(exactMatches.Single());
                }
                else
                {
                    exactMatches.Each(type => expression.Add(type));
                }


                if ([email protected]())
                {
                    addConcretionsThatCouldBeClosed(@interface, expression);
                }
            });

            _concretions.Each(type => registry.Configure(graph => graph.ConnectedConcretions.Fill(type)));
        }
예제 #6
0
 public void ScanTypes(TypeSet types, Registry registry)
 {
     types.AllTypes().Where(predicate).ToList()
          .ForEach(t => registry.ForSingletonOf(serviceSelector.Invoke(t)).Use(t));
 }
예제 #7
0
		public void ScanTypes(TypeSet types, Registry registry)
	    {
		    types.AllTypes().ForEach(t => Process(t, registry));
	    }