minor renames

This commit is contained in:
Collin M. Barrett 2019-07-12 12:52:02 -05:00
parent a87628a9dd
commit 679cf67107
2 changed files with 7 additions and 7 deletions

View file

@ -20,7 +20,7 @@ namespace FilterLists.Agent.Infrastructure.DependencyInjection
{
public static class ServiceCollectionExtensions
{
public static void RegisterAgentServices(this IServiceCollection services)
public static void ConfigureServices(this IServiceCollection services)
{
services.AddConfiguration();
services.AddLoggingCustom();

View file

@ -17,10 +17,10 @@ public static class Program
public static async Task Main(string[] args)
{
BuildServiceProvider();
Setup();
var parser = _serviceProvider.GetService<Parser>();
var mediator = _serviceProvider.GetService<IMediator>();
await parser.ParseArguments<CommandLineOptions>(args).MapResult(async o =>
{
if (o.ArchiveLists)
@ -31,17 +31,17 @@ await parser.ParseArguments<CommandLineOptions>(args).MapResult(async o =>
e => Task.FromResult(0)
);
FlushApplicationInsights();
Teardown();
}
private static void BuildServiceProvider()
private static void Setup()
{
var serviceCollection = new ServiceCollection();
serviceCollection.RegisterAgentServices();
serviceCollection.ConfigureServices();
_serviceProvider = serviceCollection.BuildServiceProvider();
}
private static void FlushApplicationInsights()
private static void Teardown()
{
var telemetryClient = _serviceProvider.GetService<TelemetryClient>();
telemetryClient.Flush();