예제 #1
0
        private static (AppOptions, GitHubOptions, TwitterOptions) BuildOptions(string[] args)
        {
            // build options
            IConfigurationRoot root = new ConfigurationBuilder()
                                      .SetBasePath(Directory.GetCurrentDirectory())
                                      .AddJsonFile("settings.json")
                                      .AddCommandLine(args)
                                      .Build();

            var appOption = new AppOptions();

            root.GetSection("App").Bind(appOption);

            var gitHubOption = new GitHubOptions();

            root.GetSection("GitHub").Bind(gitHubOption);

            var twitterOption = new TwitterOptions();

            root.GetSection("Twitter").Bind(twitterOption);

            return(appOption, gitHubOption, twitterOption);
        }
예제 #2
0
 internal Executor(AppOptions appOption, GitHubOptions gitHubOption, TwitterOptions twitterOption)
 {
     _appOption     = appOption;
     _gitHubOption  = gitHubOption;
     _twitterOption = twitterOption;
 }