private void RegisterCommandHandlers(IEnumerable <Type> commandHandlerTypes) { foreach (Type commandHandlerType in commandHandlerTypes) { CommandBindExtensions .BindCommandHandler(kernel, commandHandlerType) .InTaskScope(); } }
private void DiscoverCommandHandlers() { var commandHandlerTypes = typeExplorer.GetAllTypes() .Where(x => x.IsClass && !x.IsAbstract && !x.IsGenericTypeDefinition && CommandBindExtensions.GetCommandHandlerInterfaces(x).Length > 0) .ToArray(); RegisterCommandHandlers(commandHandlerTypes); Logger.Debug($"Discovered {commandHandlerTypes.Length} command handlers: {string.Join(", ", commandHandlerTypes.Select(x => x.FullName))}"); }