Пример #1
0
        public static int Main()
        {
            var loggerFactory = new LoggerFactory().AddConsole();

            var serviceProvider = SampleServiceProvider.Create(loggerFactory);

            return(TopshelfJob.Run <PingQueueJob>(() => serviceProvider.GetService <PingQueueJob>(), loggerFactory: loggerFactory));
        }
Пример #2
0
        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));
        }