Hi,
I am following this online example:
http://www.asp.net/web-api/overview/creating-web-apis/using-web-api-with-entity-framework/using-web-api-with-entity-framework,-part-3and need some clarification on how the data is actually getting pulled from the database.
Can someone explain to me what happens when a request is sent to http://localhost:portnum/api/admin
I think the call gets routed to
public IEnumerable<Product> GetProducts()
{
return db.Products.AsEnumerable();
}
in the AdminController.cs
And I gather that db.Products.AsEnumerable() is what actually queries the database and returns the data.
Somehow the
DbSet<Product> Products { get; set; }
defined in OrdersContext.cs gets involved here too.
My problem is that I am trying to adapt this to using an existing database of my own and can't work out how to tell it what data I want to be pulled back (I need it to call a Stored Procedure in my database).
Any help appreciated.