CQRSSample.Infrastructure.Installers.EventHandlerHelper.GetEventHandlers C# (CSharp) Method

GetEventHandlers() public static method

public static GetEventHandlers ( ) : IList>.IDictionary
return IList>.IDictionary
        public static IDictionary<Type, IList<Type>> GetEventHandlers()
        {
            var handlers = new Dictionary<Type, IList<Type>>();
            typeof(CustomerListView)
                .Assembly
                .GetExportedTypes()
                .Where(x => x.GetInterfaces().Any(y => y.IsGenericType && y.GetGenericTypeDefinition() == typeof(HandlesEvent<>)))
                .ToList()
                .ForEach(x => AddItem(handlers, x));
            return handlers;
        }