public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents)
        {
            newComponents
            .ContributeTransactionScript <HelloWorldTx>();

            newComponents
            .ContributeHttpEndpoint(name: "rest-api")
            .RouteRequestsToRestApiService(protocolName: MessageProtocolInfo.Select.HttpRestNWheelsV1().ProtocolName);
        }
Ejemplo n.º 2
0
            //-------------------------------------------------------------------------------------------------------------------------------------------------

            public override void ContributeComponents(IComponentContainer existingComponents, IComponentContainerBuilder newComponents)
            {
                newComponents.RegisterComponentType <NonStaticTestRequestHandler>().InstancePerDependency();

                newComponents.ContributeHttpEndpoint(
                    "Static",
                    onRequest: null);

                newComponents.ContributeHttpEndpoint(
                    "Dynamic",
                    onRequest: context => {
                    var handler = existingComponents.Resolve <NonStaticTestRequestHandler>();
                    return(handler.HandleRequest(context));
                });

                newComponents.ContributeHttpEndpoint(
                    "Mixed",
                    onRequest: context => {
                    var handler = existingComponents.Resolve <NonStaticTestRequestHandler>();
                    return(handler.HandleRequest(context));
                });
            }