Skip to content

NimeshDhruve/WebAPIRoutingDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebAPIRoutingDemo

After upgrading to Asp.Net Core 2.2 (from Asp.Net Core 2.1), Url.RouteURL seems to be broken.

This repo has code to demonstrate the issue.

In file Startup.cs if you uncomment line setupAction.EnableEndpointRouting = false the URL will get correctly generated other wise URL won't generate.

However by setting EnableEndpointRouting to false we loose the new Routing features introduced with 2.2.

The code for generating URL uses Url.RouteUrl:

Example: 
Url.RouteUrl("ControllerOnlyRouteName", new { controller= "MyApi"})

Example

Output

Referred in:

About

Generate Web API url using Url.RouteUrl

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors