Esempio n. 1
0
 public override void RegisterAll <TTarget>()
 {
     CheckContainer();
     Registrator.GetAssemblies().ToList().ForEach(
         a => Registrator.GetTypesImplementing <TTarget>(a).ToList().ForEach(
             t => container.Bind <TTarget>().To(t)));
 }
Esempio n. 2
0
 public override void RegisterAll(Type target)
 {
     CheckContainer();
     Registrator.GetAssemblies().ToList().ForEach(
         a => Registrator.GetTypesImplementing(a, target).ToList().ForEach(
             t => container.Bind(target).To(t)));
 }
Esempio n. 3
0
 public override void RegisterAll(Type target)
 {
     CheckContainer();
     Registrator.GetAssemblies()
     .SelectMany(a => Registrator.GetTypesImplementing(a, target))
     .ForEach(t => container.Register(Component.For(target).ImplementedBy(t)));
 }
Esempio n. 4
0
 public override void RegisterAll <TTarget>()
 {
     CheckContainer();
     UpdateContainer(cb => Registrator.GetAssemblies().ToList()
                     .ForEach(a => Registrator.GetTypesImplementing <TTarget>(a).ToList()
                              .ForEach(t => cb.RegisterType(t).As <TTarget>())));
 }
Esempio n. 5
0
 public override void RegisterAll <TTarget>()
 {
     CheckContainer();
     Registrator.GetAssemblies().ForEach(
         a => Registrator.GetTypesImplementing <TTarget>(a).ForEach(
             t => container.RegisterType(typeof(TTarget), t, t.FullName)));
 }
Esempio n. 6
0
 public override void RegisterAll(Type target)
 {
     CheckContainer();
     Registrator.GetAssemblies().ForEach(
         a => Registrator.GetTypesImplementing(a, target).ForEach(
             t => container.RegisterType(target, t, t.FullName)));
 }
Esempio n. 7
0
        public override void RegisterAll(Type target)
        {
            CheckContainer();

            container.Configure(c => Registrator.GetAssemblies()
                                .SelectMany(a => Registrator.GetTypesImplementing(a, target))
                                .ForEach(t => c.For(target).Use(t)));
        }
Esempio n. 8
0
 public override void RegisterAll <TTarget>()
 {
     CheckContainer();
     container.RegisterAll <TTarget>(
         Registrator
         .GetAssemblies()
         .SelectMany(a => Registrator.GetTypesImplementing <TTarget>(a))
         );
 }
Esempio n. 9
0
        public override void RegisterAll(Type target)
        {
            CheckContainer();
            var matchingTypes = Registrator
                                .GetAssemblies()
                                .SelectMany(a => Registrator.GetTypesImplementing(a, target));

            if (target.IsGenericType && target.GetGenericArguments().Any(a => a.FullName == null))
            {
                matchingTypes.ForEach(t => container.RegisterOpenGeneric(target, t));
            }
            else
            {
                container.RegisterAll(target, matchingTypes);
            }
        }
Esempio n. 10
0
 public override void RegisterAll(Type target)
 {
     CheckContainer();
     if (target.IsGenericType && target.GetGenericArguments().Any(a => a.FullName == null))
     {
         UpdateContainer(cb => Registrator.GetAssemblies().ToList()
                         .ForEach(a => Registrator.GetTypesImplementing(a, target).ToList()
                                  .ForEach(t => cb.RegisterGeneric(t).As(target))));
     }
     else
     {
         UpdateContainer(cb => Registrator.GetAssemblies().ToList()
                         .ForEach(a => Registrator.GetTypesImplementing(a, target).ToList()
                                  .ForEach(t => cb.RegisterType(t).As(target))));
     }
 }