Ejemplo n.º 1
0
        public void RegisterServicesByConvention(IClassLocator classLocator, IContainerBuilder builder)
        {
            foreach (var type in classLocator.FindTypesImplementing <IService>())
            {
                builder.RegisterAsImplementedInterfaces(type);
            }

            foreach (var type in classLocator.FindTypesImplementing <IStatefulService>())
            {
                builder.RegisterSingletonAsImplementedInterfaces(type);
            }
        }
Ejemplo n.º 2
0
 public void RegisterCommandHandlersByConvention(IClassLocator classLocator, IContainerBuilder builder)
 {
     foreach (var type in classLocator.FindTypesImplementing <ICommandHandler>())
     {
         builder.RegisterAsImplementedInterfaces(type);
     }
 }