You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the second and likely final preview release for ASP.NET Core with .NET 7.0 support. No additional work is planned, but there are some breaking changes that can be tried, tested, and discussed before promoting to the official release.
Features
ASP.NET Core
Added MapApiGroup() as a shortcut for MapGroup( "" ).WithApiVersionSet()
Metadata can now be added to groups (e.g. RouteGroupBuilder)
In Preview 2, metadata can now be applied even more succinctly.
varbuilder=WebApplication.CreateBuilder(args);builder.Services.AddApiVersioning();varapp=builder.Build();varorders=app.MapApiGroup();// ← api group with optional namevarv1=orders.MapGroup("/api/order").HasApiVersion(1.0);// ← all endpoints in this group have 1.0varv2=orders.MapGroup("/api/order").HasApiVersion(2.0);// ← all endpoints in this group have 2.0v1.MapGet("/{id:int}",(intid)=>newV1.Order(){Id=id,Customer="John Doe"});v2.MapGet("/{id:int}",(intid)=>newV2.Order(){Id=id,Customer="John Doe",Phone="555-555-5555"});v2.MapDelete("/{id:int}",(intid)=>Results.NoContent());
All of the previous methods of configuring metadata are still supported. For more examples, refer to the:
The following are breaking changes from Preview 1. If you haven't added any customizations, these should all be source code compatible.
Add group metadata validation to avoid common developer mistakes
Replace IApiVersionSetBuilderFactory interface with injectable ApiVersionSetBuilderFactory delegate
Refactor RouteHandlerBuidler extensions into IEndpointRouteBuilderExtensions
This allows adding metadata on an endpoint or route group
If you have additional input or feedback, please provide them in the discussion. This will likely be the last time to discuss it before the release becomes official.
This discussion was created from the release 7.0.0 Preview 2.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is the second and likely final preview release for ASP.NET Core with .NET 7.0 support. No additional work is planned, but there are some breaking changes that can be tried, tested, and discussed before promoting to the official release.
Features
ASP.NET Core
MapApiGroup()
as a shortcut forMapGroup( "" ).WithApiVersionSet()
RouteGroupBuilder
)VersionedEndpointRouteBuilderFactory
delegateIn Preview 2, metadata can now be applied even more succinctly.
All of the previous methods of configuring metadata are still supported. For more examples, refer to the:
Fixes
404
over400
when versioning only by URL segment ([OData] /odata/v1/orders() gives 400 Bad Request "Unspecified API version" #911)Breaking Changes
The following are breaking changes from Preview 1. If you haven't added any customizations, these should all be source code compatible.
IApiVersionSetBuilderFactory
interface with injectableApiVersionSetBuilderFactory
delegateRouteHandlerBuidler
extensions intoIEndpointRouteBuilderExtensions
If you have additional input or feedback, please provide them in the discussion. This will likely be the last time to discuss it before the release becomes official.
This discussion was created from the release 7.0.0 Preview 2.
Beta Was this translation helpful? Give feedback.
All reactions