2017-07-06 09:03:51 +00:00
|
|
|
|
using System;
|
2017-09-26 21:09:31 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
2017-07-06 09:03:51 +00:00
|
|
|
|
|
2017-09-26 21:09:31 +00:00
|
|
|
|
namespace DotNetCron
|
2017-07-06 09:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2017-09-26 21:09:31 +00:00
|
|
|
|
var configuration = new ConfigurationBuilder()
|
|
|
|
|
.SetBasePath(Directory.GetCurrentDirectory())
|
|
|
|
|
.AddJsonFile("appsettings.json", optional:true, reloadOnChange:true)
|
2017-09-26 21:10:02 +00:00
|
|
|
|
.AddEnvironmentVariables(prefix: "CRON_")
|
2017-09-26 21:09:31 +00:00
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var consoleSettings = new ConsoleSettings();
|
|
|
|
|
configuration.GetSection("Console").Bind(consoleSettings);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"{DateTime.UtcNow}: Output String: '{consoleSettings.OutputString}'");
|
2017-07-06 09:03:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|