Last active
May 5, 2018 21:37
-
-
Save vector623/b313c6f531d5d87987ebfd156fb12219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Program | |
{ | |
public static IConfigurationRoot Configuration { get; } | |
public static ILoggerFactory LoggerFactory { get; } | |
public static DbConnectionStringBuilder DbConnectionStringBuilder { get; } | |
static Program() | |
{ | |
Configuration = new ConfigurationBuilder() | |
.AddEnvironmentVariables("TROICENETDEV_") | |
.Build(); | |
DbConnectionStringBuilder = new NpgsqlConnectionStringBuilder() | |
{ | |
Host = Configuration["PG_HOST"], | |
Port = Convert.ToInt32(Configuration["PG_PORT"]), | |
Database = Configuration["PG_DATABASE"], | |
Username = Configuration["PG_USER"], | |
Password = Configuration["PG_PASSWORD"], | |
}; | |
Log.Logger = new LoggerConfiguration() | |
.MinimumLevel.Debug() | |
.Enrich.FromLogContext() | |
.WriteTo.Console() | |
.CreateLogger(); | |
LoggerFactory = new LoggerFactory() | |
.AddSerilog(); | |
} | |
static void Main(string[] args) | |
{ | |
using (var statusController = new StatusController(DbConnectionStringBuilder, LoggerFactory)) | |
{ | |
var status = statusController.DataSyncStatus(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment