Helper functions for working with Minimal Api in F#.
Provide convenient way to produce request Delegate compatible with IEndpointRouteBuilder.
By depending on AsParametersAttribute it allow define parameters bag and apply desired metadata attributes.
Supports AspNet Core 7.0+
Install the library from NuGet:
❯ dotnet add package Endpoints.FSharp.Interoptype HelloRequest =
{
Logger : ILogger<HelloRequest>
[<FromRoute>]
Name : string
}
let hello (req : HelloRequest) = async {
req.Logger.LogInformation("Hello request handler.")
return $"Hello {req.Name}!"
}
app.MapGet("/async/{name}", Endpoint.OfAsync hello)