Beispiel #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);
            }
        }
Beispiel #2
0
 public void RegisterCommandHandlersByConvention(IClassLocator classLocator, IContainerBuilder builder)
 {
     foreach (var type in classLocator.FindTypesImplementing <ICommandHandler>())
     {
         builder.RegisterAsImplementedInterfaces(type);
     }
 }