using MarketData.Interface;
using MarketData.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace MarketData
{
  class Program
  {
      static void Main(string[] args)
      {
        IConfigurationBuilder builder = new ConfigurationBuilder()
        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
        IConfigurationRoot configurationRoot = builder.Build();
        Arguments arguments = new Arguments(args);
        IServiceCollection services = new ServiceCollection();
        services.AddSingleton<IArguments>(arguments);
        services.AddSingleton<IConfigurationRoot>(configurationRoot);
        services.AddSingleton<IMainService,MainService>();
        services.AddSingleton<Executor,Executor>();
        services.BuildServiceProvider().GetService<Executor>().Execute();
      }
  }
}
