Ejemplo n.º 1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public static IMicroserviceHostBuilder UseMessageProtocol <TProtocol>(this IMicroserviceHostBuilder hostBuilder)
            where TProtocol : MessageProtocol
        {
            hostBuilder.ContributeComponents((existingComponents, newComponents) => {
                newComponents.ContributeMessageProtocol <TProtocol>();
            });

            return(hostBuilder);
        }
Ejemplo n.º 2
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public static IMicroserviceHostBuilder AutoDiscoverComponents(this IMicroserviceHostBuilder builder)
        {
            return(builder
                   .ContributeComponents((existingComponents, newComponents) => {
                newComponents.ContributeTransactionScript <HelloWorldTx>();
                newComponents.ContributeWebApp <HelloWorldApp>(urlPathBase: "/");
            })
                   .UseApplicationFeature <GeneratedCodePrototypesFeatureLoader>());
        }
Ejemplo n.º 3
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public static IMicroserviceHostBuilder UseRestApiHttpEndpoint <TProtocol>(this IMicroserviceHostBuilder hostBuilder, int?listenPortNumber = null)
            where TProtocol : MessageProtocol
        {
            hostBuilder.ContributeComponents((existingComonents, newComponents) => {
                newComponents
                .ContributeHttpEndpoint("rest-api", listenPortNumber: listenPortNumber)
                .ServeRestApiRequests <TProtocol>();
            });

            return(hostBuilder);
        }