ARTICLE AD BOX
Following is a part of the execution sequence when a middleware gets configured in ASP.NET Core -
// my code app.Use(some middleware); // class UseExtensions / namespace Microsoft.AspNetCore.Builder public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, RequestDelegate, Task> middleware) { return app.Use(next => context => middleware(context, next)); } // class WebApplication / namespace Microsoft.AspNetCore.Builder public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware) { ApplicationBuilder.Use(middleware); return this; }Maybe it's my lack of understanding of lambdas, but the lambda expression in the second method above giving me a hard time wrapping my head around it -
return app.Use(next => context => middleware(context, next));Could someone please help me with what could be the possible method-body equivalent of that lambda expression?
Is it possible at all? If not, why?
