public FileParserReportGenerator(TaleConfiguration configuration) { _configuration = configuration; if (string.IsNullOrEmpty(_configuration.InputFileName)) { throw new ArgumentNullException(nameof(_configuration.InputFileName)); } searchPhrase = _configuration.SearchKeyWord; }
private static void RegisterServices() { var services = new ServiceCollection(); var taleConfig = new TaleConfiguration(); IConfiguration talefiguration = new ConfigurationBuilder() .AddJsonFile("talesettings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .Build(); talefiguration.Bind(TaleConfiguration.Position, taleConfig); services.AddSingleton(taleConfig); services.AddSingleton <IFileParseReportGenerator, FileParserReportGenerator>(); services.AddSingleton <FileParserConsole>(); _serviceProvider = services.BuildServiceProvider(true); }
public FileParserConsole(IFileParseReportGenerator fileParseReportGenerator, TaleConfiguration configuration) { _fileParseReportGenerator = fileParseReportGenerator; _configuration = configuration; }