Exemple #1
0
        public static void Run <TProgramAsService, TStartup>()
            where TProgramAsService : ProgramAsServiceBase
            where TStartup : class, IStartup
        {
            var configurationServiceProvider = ServiceProviderHelper.GetNewEmptyServiceProvider();

            ProgramAsService.Run <TProgramAsService, TStartup>(configurationServiceProvider);
        }
Exemple #2
0
        public static async Task RunAsync <TProgram, TStartup>(this IProgramAsService programAsService)
            where TProgram : AsynchronousProgramAsServiceBase
            where TStartup : StartupBase
        {
            var configurationConfigurationServiceProvider = ServiceProviderServiceBuilder.New().UseStartupAndBuild <DefaultStartupConfigurationConfiguration>();
            var configurationServiceProvider = ServiceProviderServiceBuilder.New().UseStartupAndBuild <DefaultStartupConfiguration>(configurationConfigurationServiceProvider);

            await ProgramAsService.RunAsync <TProgram, TStartup>(configurationServiceProvider);
        }
Exemple #3
0
        public static Task RunAsync <TAsynchronousProgramAsService, TStartup>()
            where TAsynchronousProgramAsService : AsynchronousProgramAsServiceBase
            where TStartup : class, IStartup
        {
            var configurationServiceProvider = ServiceProviderHelper.GetNewEmptyServiceProvider();

            var task = ProgramAsService.RunAsync <TAsynchronousProgramAsService, TStartup>(configurationServiceProvider);

            return(task);
        }
Exemple #4
0
        public static IProgramAsService New()
        {
            var programAsServiceInstance = new ProgramAsService();

            return(programAsServiceInstance);
        }