Skip to content

Cleanup implementation of UseJsonApi #733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bart-degreed opened this issue May 8, 2020 · 0 comments · Fixed by #750
Closed

Cleanup implementation of UseJsonApi #733

bart-degreed opened this issue May 8, 2020 · 0 comments · Fixed by #750

Comments

@bart-degreed
Copy link
Contributor

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());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant