我想建立一个基于中间件的管道,该管道与ASP.NET核心或HTTP(考虑用于构建数据仓库的Extract,Transform和Load管道)无关。目前,这是在使用IHostBuilder
的自托管应用程序中完成的,此类解决方案有很多步骤,因此能够像ASP.NET Core一样将中间件插入管道中的模式非常吸引人。我以为我将从在下面列出的.NET Core中基于IAppBuilder
创建自己的管道构建器接口开始。
public interface IEtlPipelineBuilder
{
/// <summary>
/// Gets or sets the service provider that provides access to the ETL engines service container.
/// </summary>
IServiceProvider PipelineServices { get; set; }
/// <summary>
/// Gets the set of ETL features the engine provides.
/// </summary>
//IFeatureCollection ServerFeatures { get; }
/// <summary>
/// Gets a key/value collection that can be used to share data between middleware.
/// </summary>
IDictionary<string, object> Properties { get; }
/// <summary>
/// Adds a middleware delegate to the ETL pipeline.
/// </summary>
IEtlPipelineBuilder Use(Func<JobDelegate, JobDelegate> middleware);
/// <summary>
/// Creates a new instance of a pipeline builder that shares the properties of this IEtlPipelineBuilder
/// </summary>
IEtlPipelineBuilder New();
/// <summary>
/// Builds the delegate used by this application to process ETL job requests.
/// </summary>
JobDelegate Build();
}
现在我需要执行此操作,这是我的问题开始的地方。
我唯一想到的与问题3有关的事情可能是无法利用基于OWIN管道的其他扩展,但是请随时提供其他扩展。