'What is an alternative to RouteFactoryAttribute in asp.net core?

I am trying to implement API-versioning (APIs passed as a query) using constraints. Previously, I could use RouteFactoryAttribute and IHttpRouteConstraint. Now, there is IRouteConstraint for routing constraint; however, I don't find any alternatives to RouteFactoryAttribute that I can use.



Solution 1:[1]

add AddApiVersioning extension method to IServiceCollection to set up api versioning.

namespace: Microsoft.AspNetCore.Mvc.Versioning

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 manish