Web App Error While Returning Data from a Database

Amos Matthew 26 Reputation points

I am connected to an Azure Database in Visual Studio. Using this method, I should retrieve JSON response from the Database (According to Instructions) that looks like this:




Instead, I get this Error Message:


<Message>No HTTP resource was found that matches the request URI 'http://localhost:5000/api/Customers/1'.</Message>

<MessageDetail>No type was found that matches the controller named 'Customers'.</MessageDetail>


Can you say why my method is returning this data instead of a Customer data file? My method:

// GET: api/Customers/5


    public async Task<IHttpActionResult> GetCustomer(int id)


        Customer customer = await db.Customers.FindAsync(id);

        if (customer == null)


            return NotFound();


        return Ok (customer);

Azure SQL Database
{count} votes