Skip to content

v2.0.0-prerelease.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@Fleny113 Fleny113 released this 15 Aug 08:51
· 6 commits to main since this release
fafe51c

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.OpenApi nuget package
and add using EndpointMapper.OpenApi; for the AuthenticationRequirementOperationFilter

  • HttpMap<HttpVerb>(<routes>) has now been replaced with HttpMap(HttpMapMethod.<HttpVerb>, <routes>),
    so a HttpMapGet("/myRoute") now is HttpMap(HttpMapMethod.Get, "/myRoute")
  • All your methods that have an HttpMap attribute now needs to be static
  • The constructor based DI is no longer supported. You now need to use the DI from the method parameters
  • The Configure method now has only 1 overload, Configure(RouteHandlerBuilder, string route, string method)
  • the IEndpointConfigurationAttribute interface and the Filter<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 to MapEndpointMapperEndpoints(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 .csproj inside a PropertyGroup
  • You need at least C# 11, if you specify a LangVersion that 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 LogTimeTookToInitialize option doesn't exist anymore
  • The RoutePrefix and ConfigureGroupBuilder options 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