2018-12-31 09:59:35 +00:00
|
|
|
using Elsa.Activities.Http.Handlers;
|
|
|
|
|
using Elsa.Activities.Http.Initialization;
|
|
|
|
|
using Elsa.Activities.Http.Services;
|
|
|
|
|
using Elsa.Activities.Http.Services.Implementations;
|
2018-12-30 17:20:12 +00:00
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
|
|
|
|
2018-12-31 09:59:35 +00:00
|
|
|
namespace Elsa.Activities.Http.Extensions
|
2018-12-30 17:20:12 +00:00
|
|
|
{
|
|
|
|
|
public static class ServiceCollectionExtensions
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection AddWorkflowsHttp(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
services
|
|
|
|
|
.AddSingleton<IHttpWorkflowCache, DefaultHttpWorkflowCache>()
|
|
|
|
|
.AddAsyncInitializer<HttpWorkflowCacheInitializer>()
|
|
|
|
|
.AddSingleton<IActivityHandler, HttpRequestTriggerHandler>();
|
|
|
|
|
|
|
|
|
|
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|