dotnetcron/Program.cs
2017-09-26 22:10:02 +01:00

23 lines
727 B
C#

using System;
using System.IO;
using Microsoft.Extensions.Configuration;
namespace DotNetCron
{
class Program
{
static void Main(string[] args)
{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional:true, reloadOnChange:true)
.AddEnvironmentVariables(prefix: "CRON_")
.Build();
var consoleSettings = new ConsoleSettings();
configuration.GetSection("Console").Bind(consoleSettings);
Console.WriteLine($"{DateTime.UtcNow}: Output String: '{consoleSettings.OutputString}'");
}
}
}