/// <summary> /// Adds the provided orchestration middleware to the builder. /// </summary> /// <param name="builder">The builder to add to, not null.</param> /// <param name="func">The orchestration middleware func to add, not null.</param> /// <returns>The original builder with orchestration middleware added.</returns> public static ITaskHubWorkerBuilder UseOrchestrationMiddleware( this ITaskHubWorkerBuilder builder, Func <DispatchMiddlewareContext, Func <Task>, Task> func) { Check.NotNull(builder, nameof(builder)); Check.NotNull(func, nameof(func)); builder.UseOrchestrationMiddleware(new TaskMiddlewareDescriptor(func)); return(builder); }
/// <summary> /// Adds the provided orchestration middleware to the builder. /// </summary> /// <param name="builder">The builder to add to, not null.</param> /// <param name="type">The orchestration middleware type to add, not null.</param> /// <returns>The original builder with orchestration middleware added.</returns> public static ITaskHubWorkerBuilder UseOrchestrationMiddleware(this ITaskHubWorkerBuilder builder, Type type) { Check.NotNull(builder, nameof(builder)); builder.UseOrchestrationMiddleware(new TaskMiddlewareDescriptor(type)); return(builder); }
/// <summary> /// Adds the provided orchestration middleware to the builder. /// </summary> /// <param name="builder">The builder to add to, not null.</param> /// <typeparam name="TMiddleware">The orchestration middleware type to add.</typeparam> /// <returns>The original builder with orchestration middleware added.</returns> public static ITaskHubWorkerBuilder UseOrchestrationMiddleware <TMiddleware>(this ITaskHubWorkerBuilder builder) where TMiddleware : ITaskMiddleware => builder.UseOrchestrationMiddleware(typeof(TMiddleware));