OData API Versioning in .NET 6

Viewed 938

I would like to add OData Versioning to a .NET 6 project. The packages which are included in the project are:

Apparently 'Microsoft.AspNetCore.OData.Versioning' v5.0.0 is not compatible with 'Microsoft.AspNetCore.OData' v8.0.4.

Combination of both packages results in an error:

CS7069 Reference to type 'ODataModelBuilder' claims it is defined in 'Microsoft.AspNetCore.OData', but it could not be found

Does a new package exists or is it baked in to the Microsoft.AspNetCore.OData package?

Sam XU provided a solution; creating an extension: https://devblogs.microsoft.com/odata/api-versioning-extension-with-asp-net-core-odata-8/ Is this still the way to go, or is there an alternative while using OData >= 8.0.4?

0 Answers
Related