Exemplo n.º 1
0
 /// <summary>
 /// Build all dependant types into the messaging server
 /// </summary>
 /// <param name="type"></param>
 public void BuildRoutes([NotNull] Type type)
 {
     if (type == null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     if (type.IsInterface)
     {
         router.AddSource(type.FullName, InterfaceStack.OfInterface(type));
     }
     AddSourcesAndRoute(type);
 }
Exemplo n.º 2
0
        void AddSourcesAndRoute([NotNull] Type type)
        {
            var interfaces = type.DirectlyImplementedInterfaces();

            if (interfaces == null)
            {
                return;
            }

            foreach (var interfaceType in interfaces)
            {
                router.AddSource(interfaceType.FullName, InterfaceStack.OfInterface(interfaceType));
                router.RouteSources(type.FullName, interfaceType.FullName);
                AddSourcesAndRoute(interfaceType);
            }
        }