示例#1
0
        public static void AddGitHub(this IServiceCollection services, Action <GitHubClientOptions> gitHubClientOptions)
        {
            var darkBuilder   = services.AddDarker();
            var brightBuilder = services.AddBrighter();

            services = new ParamoreServiceCollection(services, darkBuilder, brightBuilder);
            services.GetDarker()
            .AddHandlers(typeof(GetRepositoryByName).Assembly);
            services.GetBrighter()
            .AddHandlers(typeof(CreateBranch).Assembly)
            .AddAsyncHandlers(typeof(CreateBranch).Assembly);
            services.AddSingleton <GitProcessor>();
            services.AddSingleton(provider =>
            {
                var options = new GitHubClientOptions();
                gitHubClientOptions?.Invoke(options);
                return(options);
            });
        }
示例#2
0
 public CommandHandler(GitHubClientOptions options, IQueryProcessor queryProcessor)
 {
     _client         = options.GitHubClientFactory();
     _queryProcessor = queryProcessor;
 }
示例#3
0
 public CommandHandler(GitHubClientOptions options)
 {
     _client = options.GitHubClientFactory();
 }
 public QueryHandler(GitHubClientOptions options)
 {
     _client = options.GitHubClientFactory();
 }