public IHttpActionResult Put([FromBody] Product product) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(Ok(product)); }