__Scenario__:
User likes to make the HomeController's Index as the default view when anyone visits like "http://mysite.com"
__Issue__:
I am receiving the following validation error for the following controller:
__The route template '~/' on the action named 'Index' on the controller named 'Home' cannot begin or end with a forward slash.__
```
[RoutePrefix("Home")]
public class HomeController : Controller
{
//[HttpGet("~/")] //NOTE: Does not work
HttpGet("")]
[HttpGet("Index")]
public ActionResult Index()
{
return View();
}
[HttpGet("About")]
public ActionResult About()
{
ViewBag.Message = "About page";
return View();
}
[HttpGet("Contact")]
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
```
__Workaround__:
User can remove the route prefix and instead do the following:
```
public class HomeController : Controller
{
[HttpGet("")]
[HttpGet("Home")]
[HttpGet("Home/Index")]
public ActionResult Index()
{
return View();
}
```
User likes to make the HomeController's Index as the default view when anyone visits like "http://mysite.com"
__Issue__:
I am receiving the following validation error for the following controller:
__The route template '~/' on the action named 'Index' on the controller named 'Home' cannot begin or end with a forward slash.__
```
[RoutePrefix("Home")]
public class HomeController : Controller
{
//[HttpGet("~/")] //NOTE: Does not work
HttpGet("")]
[HttpGet("Index")]
public ActionResult Index()
{
return View();
}
[HttpGet("About")]
public ActionResult About()
{
ViewBag.Message = "About page";
return View();
}
[HttpGet("Contact")]
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
```
__Workaround__:
User can remove the route prefix and instead do the following:
```
public class HomeController : Controller
{
[HttpGet("")]
[HttpGet("Home")]
[HttpGet("Home/Index")]
public ActionResult Index()
{
return View();
}
```