예제 #1
0
        public static ServiceConfigurator <T> WebApiEndpoint <T>(this ServiceConfigurator <T> configurator, Action <WebApiConfigurator> webConfigurator) where T : class
        {
            var config = new WebApiConfigurator();

            webConfigurator(config);

            configurator.BeforeStartingService(t => config.Initialize());
            configurator.BeforeStoppingService(t => config.Shutdown());

            return(configurator);
        }
        public static ServiceConfigurator <T> WebApiEndpoint <T>(this ServiceConfigurator <T> configurator, Action <WebApiConfigurator> webConfigurator) where T : class
        {
            var config = new WebApiConfigurator();

            webConfigurator(config);

            config.Build();

            configurator.BeforeStartingService(t => config.Server.OpenAsync().Wait());
            configurator.BeforeStoppingService(t => config.Server.CloseAsync().Wait());

            return(configurator);
        }