private void RegisterCommandHandlers(ContainerBuilder builder) { foreach (var type in _classLocator.Implements <ICommandHandler>()) { if (ClassLocator.Implements <ISingleton>(type)) { Trace($"register command handler: {type.Name} -> ImplementedInterfaces, SingleInstance"); builder.RegisterType(type).AsImplementedInterfaces().SingleInstance(); } else { Trace($"register command handler: {type.Name} -> ImplementedInterfaces, InstancePerDependency"); builder.RegisterType(type).AsImplementedInterfaces().InstancePerDependency(); } } }
public IEnumerable <Type> FindTypesImplementing <T>() { return(_finder.Implements <T>()); }