Repository navigation
v2.0.0-prerelease.3
Pre-release
Pre-release
·
38 commits
to main
since this release
In the prerelease 3 the public API of EndpointMapper changed quite a bit, so here are all the changes that have
been made and you have to do to update your project.
Note
If you are updating from v1 there is one extra thing to do.The swagger support is now optional, so you need to install the
EndpointMapper.OpenApinuget package
and addusing EndpointMapper.OpenApi;for theAuthenticationRequirementOperationFilter
HttpMap<HttpVerb>(<routes>)has now been replaced withHttpMap(HttpMapMethod.<HttpVerb>, <routes>),
so aHttpMapGet("/myRoute")now isHttpMap(HttpMapMethod.Get, "/myRoute")- All your methods that have an
HttpMapattribute now needs to bestatic - The constructor based DI is no longer supported. You now need to use the DI from the method parameters
- The
Configuremethod now has only 1 overload,Configure(RouteHandlerBuilder, string route, string method) - the
IEndpointConfigurationAttributeinterface and theFilter<T>attribute have been deleted. You now need to use the method based configuration AddEndpointMapper<T>(this IServiceCollection, Action<EndpointMapperConfiguration>),
AddEndpointMapper(this IServiceCollection, Action<EndpointMapperConfiguration>, params Type[])and
AddEndpointMapper(this IServiceCollection, Action<EndpointMapperConfiguration>, params Assembly[])have been removed.UseEndpointMapper(this WebApplication, bool)has been renamed toMapEndpointMapperEndpoints(this IEndpointRouteBuilder)- You need [.NET 8 and ASP.NET Core 8][getDotnet]
- You need to enable
Interceptors[^interceptors] by adding<Features>InterceptorsPreview</Features>to your.csprojinside aPropertyGroup - You need at least C# 11, if you specify a
LangVersionthat is lower then 11 you need to bump it up - The finding of your endpoints is now done at compile time via a source generator and not a runtime using reflection. Now EndpointMapper is NativeAOT friendly.
- The
LogTimeTookToInitializeoption doesn't exist anymore - The
RoutePrefixandConfigureGroupBuilderoptions do not exist anymore. You can still configure EndpointMapper to use
a route prefix using a ASP.NET Route Group
Full Changelog: 08b4d36...v2.0.0-prerelease.3