2020-10-03 10:48:25 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-01-12 19:15:57 +00:00
|
|
|
using Elsa.Builders;
|
2020-10-03 10:48:25 +00:00
|
|
|
using Elsa.Services.Models;
|
2020-01-12 19:15:57 +00:00
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
|
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
|
namespace Elsa.Activities.Http
|
|
|
|
|
{
|
|
|
|
|
public static class ReceiveHttpRequestBuilderExtensions
|
|
|
|
|
{
|
2020-10-11 12:33:18 +00:00
|
|
|
public static IActivityBuilder ReceiveHttpRequest(
|
|
|
|
|
this IBuilder builder,
|
2020-10-03 10:48:25 +00:00
|
|
|
Action<ISetupActivity<ReceiveHttpRequest>> setup) => builder.Then(setup);
|
2020-10-11 12:33:18 +00:00
|
|
|
|
|
|
|
|
public static IActivityBuilder ReceiveHttpRequest(
|
|
|
|
|
this IBuilder builder,
|
|
|
|
|
Action<ReceiveHttpRequest> setup) => builder.Then(setup);
|
|
|
|
|
|
|
|
|
|
public static IActivityBuilder ReceiveHttpRequest(this IBuilder builder,
|
|
|
|
|
Func<ActivityExecutionContext, ValueTask<PathString>> path) =>
|
2020-10-03 10:48:25 +00:00
|
|
|
builder.ReceiveHttpRequest(setup => setup.Set(x => x.Path, path));
|
2020-10-11 12:33:18 +00:00
|
|
|
|
|
|
|
|
public static IActivityBuilder ReceiveHttpRequest(this IBuilder builder,
|
|
|
|
|
Func<ActivityExecutionContext, PathString> path) =>
|
2020-10-03 10:48:25 +00:00
|
|
|
builder.ReceiveHttpRequest(setup => setup.Set(x => x.Path, path));
|
2020-10-11 12:33:18 +00:00
|
|
|
|
|
|
|
|
public static IActivityBuilder ReceiveHttpRequest(this IBuilder builder, Func<ValueTask<PathString>> path) =>
|
2020-10-03 10:48:25 +00:00
|
|
|
builder.ReceiveHttpRequest(setup => setup.Set(x => x.Path, path));
|
2020-10-11 12:33:18 +00:00
|
|
|
|
|
|
|
|
public static IActivityBuilder ReceiveHttpRequest(this IBuilder builder, Func<PathString> path) =>
|
2020-10-03 10:48:25 +00:00
|
|
|
builder.ReceiveHttpRequest(setup => setup.Set(x => x.Path, path));
|
2020-10-11 12:33:18 +00:00
|
|
|
|
|
|
|
|
public static IActivityBuilder ReceiveHttpRequest(this IBuilder builder, PathString path) =>
|
|
|
|
|
builder.ReceiveHttpRequest(x => x.Path = path);
|
2020-01-12 19:15:57 +00:00
|
|
|
}
|
|
|
|
|
}
|