Skip to content

Instantly share code, notes, and snippets.

@vmandic
Created May 14, 2019 07:55
Show Gist options
  • Select an option

  • Save vmandic/0254997e96e452b477084c3bc9c8a467 to your computer and use it in GitHub Desktop.

Select an option

Save vmandic/0254997e96e452b477084c3bc9c8a467 to your computer and use it in GitHub Desktop.
meds-processor, part/4, snippet #10
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