aspnetcore
aspnetcore copied to clipboard
Multiple attributes in WebApi
Hi guys,
I'm working on a WebAPI project right now, but I can't get multiple variable routing to work. What am I doing wrong?
My controller has this route: [Route( "api/[controller]" )]
My action has this one:
[HttpGet]
[EnableCors( "mypolicy" )]
[Route( "GetTimeFrameMessages/{ timeRangeMin }/{ timeRangeMax }" )]
public IList
When I try to run this, with http://localhost:58496/api/search/GetTimeFrameMessages/1439423756203/1439452556203 as url, both timeRangeMin and timeRangeMax are null...
Does someone know what I'm missing?
Thanks!
I figured out what was wrong. Apparently Routing cannot have spaces...