Created
May 14, 2019 07:55
-
-
Save vmandic/0254997e96e452b477084c3bc9c8a467 to your computer and use it in GitHub Desktop.
meds-processor, part/4, snippet #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Threading.Tasks; | |
| using MedsProcessor.WebAPI.Core; | |
| using Microsoft.AspNetCore; | |
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.Extensions.DependencyInjection; | |
| namespace MedsProcessor.WebAPI | |
| { | |
| public class Program | |
| { | |
| public static async Task Main(string[] args) | |
| { | |
| var host = CreateWebHostBuilder(args).Build(); | |
| var processor = host.Services.GetService<HzzoDataProcessor>(); | |
| #pragma warning disable | |
| // no need to wait for processor to finish | |
| processor.Run(); | |
| #pragma warning enable | |
| await host.RunAsync(); | |
| } | |
| private static IWebHostBuilder CreateWebHostBuilder(string[] args) => | |
| WebHost.CreateDefaultBuilder(args).UseStartup<Startup>(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment