Skip to content
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

Deprecate HttpStatusCodeHandlers.fs in favor if Minimal API IResult #519

Open
xperiandri opened this issue Aug 21, 2022 · 0 comments
Open

Comments

@xperiandri
Copy link

I propose to add the function below to the Core.fs and deprecate HttpStatusCodeHandlers.fs

open Microsoft.AspNetCore.Http
open Giraffe

let result (res: IResult) : HttpHandler =
    fun (_: HttpFunc) (ctx: HttpContext) -> task {
        do! res.ExecuteAsync(ctx)
        return Some ctx
    }

Because:

  1. Less stuff to support
  2. Known to ASP.NET developer
  3. More sophisticated
  4. Easier to support OpenAPI metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant