I'm having trouble returning json on my mvc 5 api.
In the Get method it returns a string in this format:
public string Get()
{
return "{\"data\":[{\"Codigo\":\"AAAA\",\"Finalidade\":\"AAAA\"},{\"Codigo\":\"AAAA\",\"Finalidade\":\"AAAA\"}]}"
}
When I request on my page localhost:9640/api/apiimovel?formato=json
look at the format:
"{\"data\":[{\"Codigo\":\"AAAA\",\"Finalidade\":\"AAAA\"},{\"Codigo\":\"AAAA\",\"Finalidade\":\"AAAA\"}]}"
But when I do this query by the normal controller json returns correct !!
What is this problem?