public HistoricDataGrabTask(ILogger logger, IContainer container, IDataArgs dataArgs)
        {
            _logger    = logger;
            _container = container;
            _dataArgs  = dataArgs;

            _securityDataRetriever = _container.Resolve <ISecurityDataRetriever>();
            _persistenceManager    = _container.Resolve <IPersistenceManager>();
            _dataModelFactory      = _container.Resolve <IDataModelFactory>();

            _logger.Information("HistoricDataGrabTask: Instantiation successful.");
        }
        public IDataGrabTask GetDataGrabTask(IContainer container, IDataArgs dataArgs)
        {
            switch (dataArgs.Task)
            {
            case TaskType.Historic:
                return(new HistoricDataGrabTask(_logger, container, dataArgs));

            case TaskType.FileBased:
                return(new FileBasedDataGrabTask(_logger, container, dataArgs));

            default:
                throw new ArgumentException("Unsupported task type specified.");
            }
        }
        public static void Main(string[] args)
        {
            Console.WriteLine("RedSpiderTech Securities Research");
            Console.WriteLine("Supported arguments:\nhistoric <symbol>\nupdate-existing\nfile-based <filePath>");

            _appConfigurationManager = new AppConfigurationManager();

            string logFile = _appConfigurationManager.GetLogFile();

            Log.Logger = new LoggerConfiguration()
                         .WriteTo.Console(LogEventLevel.Verbose)
                         .WriteTo.File(logFile, rollingInterval: RollingInterval.Day, restrictedToMinimumLevel: LogEventLevel.Verbose)
                         .CreateLogger();

            _logger = Log.Logger;

            args = GetTestArguments();
            var       argumentParser = new ArgumentParser(args);
            IDataArgs dataArgs       = argumentParser.GetArgumentData();

            _logger.Information("RedSpiderTech Securities Research");
            _logger.Information("======================================");
            _logger.Information("Starting Security Data Research - Data Grab");
            _logger.Information("");

            InitialiseContainer();

            var           dataGrabTaskFactory = _container.Resolve <IDataGrabTaskFactory>();
            IDataGrabTask dataGrabTask        = dataGrabTaskFactory.GetDataGrabTask(_container, dataArgs);

            dataGrabTask.Execute();

            _logger.Information("");
            _logger.Information("Data Grab complete");
            _logger.Information("======================================");
        }