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(Queries.GetRepositoryByName).Assembly); services.GetBrighter() .AddHandlers(typeof(Commands.CreateBranch).Assembly) .AddAsyncHandlers(typeof(Commands.CreateBranch).Assembly); services.AddSingleton <GitProcessor>(); services.AddSingleton <GitHubClientOptions>((provider) => { var options = new GitHubClientOptions(); gitHubClientOptions?.Invoke(options); return(options); }); }
public GitProcessor(IAmACommandProcessor commandProcessor, IQueryProcessor queryProcessor, GitHubClientOptions gitHubClientOptions) { _commandProcessor = commandProcessor; _queryProcessor = queryProcessor; _gitHubClientOptions = gitHubClientOptions; }