I just started learning web API using ASP.NET. I created a new project from visual studio and trying to understand MVC folder structure and API calls.
Here what I want to know is: why do we need IEnumerable<string> before the get method.
In myValuesController.cs,
// GET api/values
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
According to the Microsoft Documentation, this exposes the enumerator, which supports a simple iteration over a collection of a specified type but think if I have an integer in my database do I need to convert it into string as well?