I'm trying to handle these requests with the same controller action:
localhost:52000/api/messageslocalhost:52000/api/messages?page=1localhost:52000/api/messages?date=2019/29/11&page=1
I made a controller action as following:
[Route("api/messages")]
[HttpGet]
public HttpResponseMessage getMessage(DateTime? date, int? page)
But this only works if the query string value is null, not if the actual query is null.
Working:
localhost:52000/api/messages?date=&page=Not working (It doesn't find the action):
localhost:52000/api/messages
How can I make every
api/messagesrequest be handled by thegetMessage()action?
Thanks!