Exemple #1
0
        public static async Task RegisterPluginAsync(IRoutingSender sender, IRoutingRegistration registration, PluginMetadata pluginMetadata)
        {
            if (pluginMetadata.ServiceType != ServiceType.MessageHandler)
            {
                return;
            }

            var plugin = CreatePlugin(pluginMetadata, sender);

            var routes = RouteDiscoverer.Discover(pluginMetadata);

            foreach (var route in routes)
            {
                await RegisterRouteAsync(registration, plugin, route);
            }
        }