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.AddFalco
IServiceCollection.AddFalco (routeOptions : RouteOptions -> unit)
IApplicationBuilder.UseFalco (endpoints : HttpEndpoint list)
IApplicationBuilder.UseFalcoExceptionHandler (exceptionHandler : HttpHandler)
QueryCollectionReader
replacing direct usage ofStringCollectionReader
HeaderCollectionReader
RouteCollectionReader
Removals
Extensions
HttpRequest.GetHeader
HttpRequest.GetRouteValues
HttpRequest.GetRouteReader
Exceptions
type ExceptionHandler
type ExceptionHandlingMiddleware
Host module
Host.defaultExceptionHandler
Host.defaultNotFoundHandler
Host.startWebHostDefault
Host.startWebHost
IApplicationBuilder.UseHttpEndpoints (endpoints : HttpEndpoint list)
- replaced by
IApplicationBuilder.UseFalco (endpoints : HttpEndpoint list)
- replaced by
Request module
Request.getHeader
Request.getRouteValues
- replace by
Request.getRoute
- replace by
Request.tryGetRouteValue
StringCollectionReader
?
dynamic operator