public IQueryable<Products> GetProducts()
value doesn't match the type you are returning. But since you're returning a concrete type, rather than an
, that attribute is not required on this action.
HttpResponseMessage response = client.GetAsync("api/Products").Result;
var products = response.Content.ReadAsStringAsync().Result;
grvProducts.DataSource = products;
to synchronously get the result of a task. Instead, make your method
will return a
, which is not a suitable
. Either use
, or parse the JSON string returned from
into a list of
Beyond that, if you're not getting any data back, then that means there is no data in your database. You need to check the database to find out why.