v3.0
With .NET 5.0 finally here, it seemed like a good time to move to v3.x.x which will support both the netcoreapp3.1 and net5.0 build targets. The major version upgraded represented an opportunity to re-evaulate certain features of the API and determine if there were any missed opportunties.
The most practical upgrade was surrounding IHost creating, for which a computation expression has been included: webHost args { ... }. With that came registration & activation extension methods for IServiceCollection and IApplicationBuilder respectively. They are aptly named services.AddFalco() and app.UseFalco(endpoints). The global exception handler hook has been renamed app.UseFalcoExceptionHandler(...).
How you interact with header and route values, now directly matches interactions with queries and forms, all enabled by the StringCollectionReader. A third set of methods was added to this class supporting "get or default" functionality.
Please note, that the
?dynamic operator has been removed.
Listed below is the full list of additions and removals:
Additions
IServiceCollection.AddFalcoIServiceCollection.AddFalco (routeOptions : RouteOptions -> unit)IApplicationBuilder.UseFalco (endpoints : HttpEndpoint list)IApplicationBuilder.UseFalcoExceptionHandler (exceptionHandler : HttpHandler)QueryCollectionReaderreplacing direct usage ofStringCollectionReaderHeaderCollectionReaderRouteCollectionReader
Removals
Extensions
HttpRequest.GetHeaderHttpRequest.GetRouteValuesHttpRequest.GetRouteReader
Exceptions
type ExceptionHandlertype ExceptionHandlingMiddleware
Host module
Host.defaultExceptionHandlerHost.defaultNotFoundHandlerHost.startWebHostDefaultHost.startWebHostIApplicationBuilder.UseHttpEndpoints (endpoints : HttpEndpoint list)- replaced by
IApplicationBuilder.UseFalco (endpoints : HttpEndpoint list)
- replaced by
Request module
Request.getHeaderRequest.getRouteValues- replace by
Request.getRoute
- replace by
Request.tryGetRouteValue
StringCollectionReader
?dynamic operator