Dependency Injection in ASP.NET Core Middleware

2022年6月24日 72点热度 1人点赞 0条评论
内容目录
    public async static Task (this IApplicationBuilder app)
    {
	
app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilder>>()
	}

{
    public interface IApplicationBuilder
    {

        IFeatureCollection ServerFeatures { get; }

        IDictionary<string, object?> Properties { get; }

        RequestDelegate Build();

        IApplicationBuilder New();
		
        IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware);
    }

痴者工良

高级程序员劝退师

文章评论