Ejemplo n.º 1
0
        public static IMicroserviceHostBuilder UseAutofac(this IMicroserviceHostBuilder builder)
        {
            ((MicroserviceHostBuilder)builder).BootConfig.MicroserviceConfig.InjectionAdapter = new MicroserviceConfig.InjectionAdapterElement {
                Assembly = typeof(ComponentContainer).AssemblyShortName()
            };

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

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

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

        public static IMicroserviceHostBuilder AutoDiscoverComponents(this IMicroserviceHostBuilder builder)
        {
            return(builder
                   .ContributeComponents((existingComponents, newComponents) => {
                newComponents.ContributeTransactionScript <HelloWorldTx>();
                newComponents.ContributeWebApp <HelloWorldApp>(urlPathBase: "/");
            })
                   .UseApplicationFeature <GeneratedCodePrototypesFeatureLoader>());
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
 public static IMicroserviceHostBuilder UseDefaultWebStack(this IMicroserviceHostBuilder builder, int listenPortNumber)
 {
     return(builder
            .UseAutofac()
            .UseKestrel()
            .UseAngular()
            .UseMessaging()
            .UseRest()
            .UseUidl()
            .UseMessageProtocol <HttpRestNWheelsV1Protocol>()
            .UseRestApiHttpEndpoint <HttpRestNWheelsV1Protocol>(listenPortNumber));
 }
Ejemplo n.º 6
0
 public static IMicroserviceHostBuilder UseKestrel(this IMicroserviceHostBuilder hostBuilder)
 {
     return(hostBuilder.UseFrameworkFeature <KestrelFeatureLoader>());
 }
Ejemplo n.º 7
0
 public static IMicroserviceHostBuilder UseAngular(this IMicroserviceHostBuilder hostBuilder)
 {
     hostBuilder.UseFrameworkFeature <WebAngularFeatureLoader>();
     return(hostBuilder);
 }
Ejemplo n.º 8
0
 public static MicroserviceHost Build(this IMicroserviceHostBuilder hostBuilder)
 {
     return(((MicroserviceHostBuilder)hostBuilder).Build());
 }
Ejemplo n.º 9
0
 public static IMicroserviceHostBuilder UseRest(this IMicroserviceHostBuilder hostBuilder)
 {
     hostBuilder.UseFrameworkFeature <RestApiFeatureLoader>();
     return(hostBuilder);
 }
Ejemplo n.º 10
0
 public static IMicroserviceHostBuilder UseMessaging(this IMicroserviceHostBuilder hostBuilder)
 {
     return(hostBuilder);
 }
Ejemplo n.º 11
0
 public static IMicroserviceHostBuilder UseUidl(this IMicroserviceHostBuilder hostBuilder)
 {
     return(hostBuilder);
 }