// GET api/Product/5 public Product GET([FromODataUri]int id) { Product product = db.Products.Find(id); if (product == null) { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); } return product; }
this is above to get the object with id is never called with my url:
http:
even with the default settings in the odata route, this is not called.
At first I tried with odata route settings:
config.Routes.MapODataRoute("ODataRoute", "odata", GetEdmModel());
Remember that my simple βGet with requestsβ query works fine. but this is the only thing that works, and the PUT method works. others all do not work. This is a kind of controller. I tried for about a day .. please help.
public class ProductController : ODataController { private OfferAssistantDbContext db = new OfferAssistantDbContext();
ahmadalibaloch
source share