public void ConfigureServices(IServiceCollection services) { services.AddSwaggerGen(c => { var basePath = AppContext.BaseDirectory; c.SwaggerDoc("v1", new OpenApiInfo { Title = "Slack integration", Version = "v1", Description = File.ReadAllText(Path.Combine(basePath, "README.md")) }); }); services.Configure <AppOptions>(Configuration); services.AddMvc(); services.AddSingleton(_ => new MessageThrottler(Scheduler.Default)); services.AddSingleton <ISlackMessaging, SlackMessaging>(); services.AddTransient <ISlackActionFetcher, SlackActionFetcher>(); ActionFactory.AddActionFactoryServicesToDi(serviceCollection: services); services.AddTransient <ActionFactory>(); }