lundi 15 août 2016

How to create GET method in API controller with parametres (e.g. sort query or search query)?

I have an API controller and GET method like this :

public IEnumerable<CountryDTO> GetContries(string sortOrder, string searchString)
    {
        return countryRepository.GetCos(sortOrder,  searchString);
    }

but when I try to get url api/countries I`ve got an error like: The requested resource does not support http method 'GET'.

How to fix this problem?




Aucun commentaire:

Enregistrer un commentaire