Giter Site home page Giter Site logo

Comments (5)

commonsensesoftware avatar commonsensesoftware commented on June 11, 2024 1

Is this for ASP.NET Core or ASP.NET Web API? It's hard to tell. It looks like it might be ASP.NET Core due to the services variable name, so I'll roll with that assumption.

Starting in 6.0, all of the API Versioning features hang off of IApiVersioningBuilder. This centralizes configuration in a consistent way. The change is documented in the migration guide.

It's not clear if you only have Minimal APIs or you also have controllers. Regardless, the configuration is nearly identical:

var builder = WebApplication.CreateBuilder( args );
var services = builder.Services;

services.AddApiVersioning()     // Core API Versioning services with support for Minimal APIs
        .AddMvc()               // API version-aware extensions for MVC Core with controllers (not full MVC)
        .AddApiExplorer()       // API version-aware API Explorer extensions

The API Explorer extensions are included in Asp.Versioning.Mvc.ApiExplorer. The old extension method was AddVersionedApiExplorer because it would have otherwise been ambiguous with the built-in AddApiExplorer. Now that the extension methods all hang off of IApiVersioningBuilder, the names can be more succinct and are unambiguous.

from aspnet-api-versioning.

julianalsemmani avatar julianalsemmani commented on June 11, 2024

Sorry for not being more specific. It's for ASP.NET Core Web API.

from aspnet-api-versioning.

commonsensesoftware avatar commonsensesoftware commented on June 11, 2024

No worries. I figured as much. ASP.NET Web API runs on the ASP.NET (4.x) Classic stack using the .NET Framework. You can, however, build a web API on ASP.NET Core, which runs on .NET. They are both ASP.NET and you can build web APIs with them both. API Versioning supports them both. 90%+ of the time people mean ASP.NET Core, but every once in a while, a question or issue comes up about the old stack, so I like to clarify. Thanks MS Marketing for making things unambiguously easy to understand! 😵‍💫

Hopefully, that solution works for you.

from aspnet-api-versioning.

julianalsemmani avatar julianalsemmani commented on June 11, 2024

I got one more question. In the Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer I was using "IApiVersionDescriptionProvider". Is there any alternatives for this in Asp.Versioning?

I tried installing Asp.Versioning.WebApi, but do I need Asp.Versioning.Mvc as well?

from aspnet-api-versioning.

julianalsemmani avatar julianalsemmani commented on June 11, 2024

Solved this! Figured out that I needed to use Asp.Versioning.Mvc and not the Asp.Versioning.WebApi!

@commonsensesoftware Thanks for helping out with the other stuff! I'll close this issue! 😄

from aspnet-api-versioning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.