Closed
Description
We recently added several flags to deal with middleware pipeline ordering issues in NetCore3. A better approach would be to move the inverse relationship building logic into the configuration phase.
And then only call:
app.UseMiddleware<JsonApiMiddleware>(); // old name: CurrentRequestMiddleware
from within this method. This allows callers to order/omit steps as they like, without sending us flags. Requires updates to documentation too.
Before:
public void Configure(IApplicationBuilder app)
{
app.UseJsonApi();
}
After:
public void Configure(IApplicationBuilder app)
{
app.UseRouting();
app.UseAuthentication(); // optional
app.UseAuthorization(); // optional
app.UseJsonApi();
app.UseEndpoints(endpoints => endpoints.MapControllers());
}