public static int Main() { var loggerFactory = new LoggerFactory().AddConsole(); var serviceProvider = SampleServiceProvider.Create(loggerFactory); return(TopshelfJob.Run <PingQueueJob>(() => serviceProvider.GetService <PingQueueJob>(), loggerFactory: loggerFactory)); }
public static int Main() { var loggerFactory = new LoggerFactory(); loggerFactory.AddNLog(); var serviceProvider = ServiceProvider.FindAndGetServiceProvider(typeof(PingQueueJob), loggerFactory); return(TopshelfJob.Run <PingQueueJob>(() => serviceProvider.GetService <PingQueueJob>(), loggerFactory: loggerFactory)); }