Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Few questions about web api versioning in core

$
0
0
just read a article on web api core versioning from this url http://www.c-sharpcorner.com/article/asp-net-core-api-versioning-in-simple-words-update-1-2-0/

i have few question about
[ApiVersion("2.0")]  and MapToApiVersion("2.0")


1) why we need to use two attribute for a controller and action called
[ApiVersion("2.0")]  and MapToApiVersion("2.0").


if i use
[ApiVersion("2.0")]
for controller then it should work for whole controller then why i need to decorate action with
MapToApiVersion("2.0")


2) why
[ApiVersion("1.0")]  and [Route("api/v{version:apiVersion}/[controller]")]

needed to decorate controller for versioning ?

3) this attribute
MapToApiVersion("2.0")
is used for action only and this [ApiVersion("1.0")] used for controller only ?


4)
[ApiVersion("2.0")] or MapToApiVersion("2.0")
for versioning then how web api action url would look like ?


please guide me.

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>