コード例 #1
0
 public FileParserReportGenerator(TaleConfiguration configuration)
 {
     _configuration = configuration;
     if (string.IsNullOrEmpty(_configuration.InputFileName))
     {
         throw new ArgumentNullException(nameof(_configuration.InputFileName));
     }
     searchPhrase = _configuration.SearchKeyWord;
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: bipsinfy/TaleOf2Cities
        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);
        }
コード例 #3
0
 public FileParserConsole(IFileParseReportGenerator fileParseReportGenerator, TaleConfiguration configuration)
 {
     _fileParseReportGenerator = fileParseReportGenerator;
     _configuration            = configuration;
 }