I have defined attribute route which takes two parameter as datetime
[Route("{controller}/{action}/{*startDate:datetime}/{*endDate:datetime}")]
public bool OverView(DateTime startDate,DateTime endDate)
{
var dt = startDate.ToString("yyyy-MM-dd");
return true;
}
But not sure, how it is possible. The attribute route works fine for a single parameter, but no sure how it will work for 2 params. Also it's hard to know how it will distinguish two parmeters from the url
Single param which is work fine
http://domain.com/Home/overview/2014/02/01
What will be the url for two params? I tried the below one but got an exception
http://domain.com/Home/overview/2014/02/01/2014/02/04
Exception
A catch-all parameter can only appear as the last segment of the route URL.
Parameter name: routeUrl