I've found enough MVC 4 API samples that use a hard-coded array as the data source, but am having trouble finding a simple example with and SQL query.
I have this model:
public class Person
{
public int id {get;set;}
public string Name {get;set;}
}
and I would like to construct a controller that returns a list of Person using this database query:
select id, name from names order by name
If it matters, the connection string to the database:
Server=sql12;Database=Mydb;Integrated Security=true;"
Thanks in advance!