Hi Team,
Framework - Dot Net Core 2.0
Application - Rest Web API
I want to remove the controller name from my URL (for one specific controller). For example:
http://mydomain.com/MyController/MyAction
I would want this URL to be changed to:
http://mydomain.com/MyAction
Startup.cs file
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
} public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseMvc();
}
Controller file.
[Route("[controller]/[action]")]
public class ValueController : Controller
{
[Route("{username}")]
[HttpGet]
public GetUserRoles(string username)
{
}
}
Regards,
Pritesh